Issue #3537 has been updated by David Burke.

On the apt-get update use case, there is also an annoyance of having each 
puppet check to be a "change". I don't consider checking for a updated package 
to be a change if the package was determined to be up to date already. If I 
want to make use of package it seems I then have to accept all puppet node 
check ins to be "changes" or accept it will fail on occasion from not having up 
to date sources.

I agree also with Alex's suggestion on refreshdb. This seems a very common use 
case for puppet. It doesn't seem obvious to me (a very new user) that you would 
need to exec apt-get update for package to work right but you really do or you 
will get errors occasionally.
----------------------------------------
Feature #3537: It should be possible to trigger (exec) resources with require
https://projects.puppetlabs.com/issues/3537#change-80718

Author: Kjetil Torgrim Homme
Status: Needs Decision
Priority: Normal
Assignee: eric sorenson
Category: metaparameters
Target version: 
Affected Puppet version: 0.25.4
Keywords: 
Branch: 


When an Exec has conditions associated with it (unless, creates, onlyif), it 
can be useful to be state prerequisites which are only run when the exec itself 
is run.

Consider this simple example::
<pre>
  exec { "prereq":
      command => "/bin/echo prereq",
      refreshonly => true
 }
  
  exec { "main":
      command => "/bin/echo main",
      onlyif  => "/bin/grep foobar /etc/issue",
      require => Exec["prereq"]
 }
</pre>
Here, the refreshonly will cause "prereq" to never run, since a require isn't 
enough to trigger it.  Without refreshonly, it will run every time, but the 
desired behaviour is that "prereq" is run iff the onlyif command succeeds.

Obviously the behaviour of "refreshonly => true" can't change, and I can't 
think of a good name for a tri-state alternative -- "refreshonly => 
'requires-too'" ?  "allevents" may be more workable.

My prefered solution would be a new parameter "requireonly".  Perhaps slightly 
misleading name, since "before" should trigger execution, too, but I think most 
people will understand that require/before are inherently intertwined.  This 
could later be generalised into a metaparameter to work for more types, e.g. 
you could have a parent File which is only checked/updated/created when some 
other File requires it.



-- 
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