Issue #11055 has been updated by R.I. Pienaar.

Nigel Kersten wrote:
> Because it's not really idempotent, much like the Mac package resource 
> dropping file turds isn't really idempotent.
> 

+1, you're not testing the actual result of the commands being run you're 
testing the state of some other only casually related file.

If you're running SQL commands you should find a way to verify that the SQL 
commands were run like with a version string the same way db migrations work.

Otherwise if someone/something like fsck nukes these semaphore files you can 
potentially re-run dangerous SQL and destroy production data.

Promoting more use of this feature will just lead users down a path of bad 
practices.

The benefit of the resources modeled with proper types/providers are that they 
validate the actual state of the thing being managed not some loosely related 
proxy file
----------------------------------------
Feature #11055: directory needed for exec's to hold output for creates attribute
https://projects.puppetlabs.com/issues/11055

Author: Garrett Honeycutt
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


The example to demonstrate the creates attribute from our documentation is as 
follows as places the output in an arbitrary location.
<pre>
exec { "tar -xf /Volumes/nfs02/important.tar":
    cwd => "/var/tmp",
    creates => "/var/tmp/myfile",
    path => ["/usr/bin", "/usr/sbin"]
}
</pre>

In order to keep state with exec's, I have been creating a directory under 
puppet's directory tree with a puppet class and including that in every module 
that uses exec and needs to keep state with the creates attribute. This does 
not scale across puppet distributions and plunges the modules into dependency 
hell.

The fix would be to have something similar to $module_path, so that one could 
specify the directory in puppet.conf and access it in their manifests via a 
variable. This solves the dependency issue with modules and allows packagers to 
place the directory where it makes sense for their distribution.

Then the above code might look like
<pre>
exec { "tar -xf /Volumes/nfs02/important.tar":
    cwd => "/var/tmp",
    creates => "$exec_state_path/myfile",
    path => ["/usr/bin", "/usr/sbin"]
}
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to