From b52fbf4e3c8cac2956c8a0d301f91d8eb081f994 Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 15 Aug 2011 17:11:00 -0700 Subject: (#8612) Clarify the function of the example for exec's "creates" parameter It was not clear to all readers that /var/tmp/myfile was being extracted from the tarball. This commit adds a sentence to make the conditions when the exec will run more explicit and fixes an error in the tar command. --- lib/puppet/type/exec.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index 3ba488f19..35e0c96d7 100755 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -311,17 +311,20 @@ module Puppet end newcheck(:creates, :parent => Puppet::Parameter::Path) do - desc "A file that this command creates. If this + desc <<-EOT + A file that this command creates. If this parameter is provided, then the command will only be run - if the specified file does not exist: + if the specified file does not exist. - exec { \"tar xf /my/tar/file.tar\": - cwd => \"/var/tmp\", - creates => \"/var/tmp/myfile\", - path => [\"/usr/bin\", \"/usr/sbin\"] + exec { "tar -xf /Volumes/nfs02/important.tar": + cwd => "/var/tmp", + creates => "/var/tmp/myfile", + path => ["/usr/bin", "/usr/sbin"] } - " + In this example, if `/var/tmp/myfile` is ever deleted, the exec + will bring it back by re-extracting the tarball. + EOT accept_arrays -- cgit