diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-08 22:57:07 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-08 22:57:07 +0000 |
commit | 387db24ca5047073876e630a51a73838ffc50d0c (patch) | |
tree | 8530c53cdc7b9775fa341d1ea224aae2a3e17a88 | |
parent | 2ce061a8215f6f23ee55af93a2c420800ade242c (diff) | |
download | puppet-387db24ca5047073876e630a51a73838ffc50d0c.tar.gz puppet-387db24ca5047073876e630a51a73838ffc50d0c.tar.xz puppet-387db24ca5047073876e630a51a73838ffc50d0c.zip |
Adding answerfile support to sun pkgs.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@888 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/type/package.rb | 8 | ||||
-rwxr-xr-x | lib/puppet/type/package/sun.rb | 11 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index c7242cd14..65bb93993 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -280,6 +280,14 @@ module Puppet desc "A read-only parameter set by the package." end + newparam(:answerfile) do + desc "A file containing any necessary answers to questions asked by + the package. This is currently only used on Solaris. The + value will be validated according to system rules, which in + the case of Solaris means that it should either be a fully qualified + path or it should be in /var/sadm/install/admin." + end + # FIXME Version is screwy -- most package systems can't specify a # version, but people will definitely want to query versions, so # it almost seems like versions should be a read-only state, diff --git a/lib/puppet/type/package/sun.rb b/lib/puppet/type/package/sun.rb index a9a8116d7..3937e2804 100755 --- a/lib/puppet/type/package/sun.rb +++ b/lib/puppet/type/package/sun.rb @@ -4,7 +4,16 @@ module Puppet unless self[:source] raise Puppet::Error, "Sun packages must specify a package source" end - cmd = "pkgadd -d %s -n %s 2>&1" % [self[:source], self[:name]] + #cmd = "pkgadd -d %s -n %s 2>&1" % [self[:source], self[:name]] + cmd = ["pkgadd"] + cmd += ["-d", self[:source]] + cmd += ["-n", self[:name]] + + if self[:answerfile] + cmd += ["-a", self[:answerfile]] + end + cmd << "2>&1" + cmd = cmd.join(" ") self.info "Executing %s" % cmd.inspect output = %x{#{cmd} 2>&1} |