diff options
| author | nfagerlund <nick.fagerlund@gmail.com> | 2011-08-15 17:11:00 -0700 |
|---|---|---|
| committer | nfagerlund <nick.fagerlund@gmail.com> | 2011-08-15 17:14:21 -0700 |
| commit | b52fbf4e3c8cac2956c8a0d301f91d8eb081f994 (patch) | |
| tree | 32c9aedd6b462eac021fa54dbe535c27b86c8430 | |
| parent | 1ce2973e8af2300aff2b042257d8181855cf887d (diff) | |
| download | puppet-b52fbf4e3c8cac2956c8a0d301f91d8eb081f994.tar.gz puppet-b52fbf4e3c8cac2956c8a0d301f91d8eb081f994.tar.xz puppet-b52fbf4e3c8cac2956c8a0d301f91d8eb081f994.zip | |
(#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.
| -rwxr-xr-x | lib/puppet/type/exec.rb | 17 |
1 files changed, 10 insertions, 7 deletions
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 |
