diff options
| author | Mark Plaksin <happy@usg.edu> | 2008-08-14 16:06:54 -0400 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2008-08-20 01:00:32 +1000 |
| commit | b6609ee5f4e6bffc467da4f3f9623f22e9e07095 (patch) | |
| tree | 8f85b1661d6611d6a0a16c775281a511bc8d3588 /lib | |
| parent | 3e482a27191d2f90e2e281ad19f3143034584f0f (diff) | |
| download | puppet-b6609ee5f4e6bffc467da4f3f9623f22e9e07095.tar.gz puppet-b6609ee5f4e6bffc467da4f3f9623f22e9e07095.tar.xz puppet-b6609ee5f4e6bffc467da4f3f9623f22e9e07095.zip | |
Fixed #1508 - Add HP-UX package provider.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/provider/package/hpux.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/puppet/provider/package/hpux.rb b/lib/puppet/provider/package/hpux.rb new file mode 100644 index 000000000..aa756ead0 --- /dev/null +++ b/lib/puppet/provider/package/hpux.rb @@ -0,0 +1,41 @@ +# HP-UX packaging. + +require 'puppet/provider/package' + +Puppet::Type.type(:package).provide :hpux, :parent => Puppet::Provider::Package do + desc "HP-UX's packaging system." + commands :swinstall => "/usr/sbin/swinstall", + :swlist => "/usr/sbin/swlist", + :swremove => "/usr/sbin/swremove" + defaultfor :operatingsystem => 'hp-ux' + + def self.instances + # TODO: This is very hard on HP-UX! + [] + end + + # source and name are required + def install + raise ArgumentError, "source must be provided to install HP-UX packages" unless resource[:source] + args = standard_args + ["-s", resource[:source], resource[:name]] + swinstall(*args) + end + + def query + begin + swlist resource[:name] + {:ensure => :present} + rescue + {:ensure => :absent} + end + end + + def uninstall + args = standard_args + [resource[:name]] + swremove(*args) + end + + def standard_args + return ["-x", "mount_all_filesystems=false"] + end +end |
