Issue #3537 has been updated by eric sorenson.
Sorry for a lack of updates. This is one that nigel transferred over to me when I started and it was lost in a flood of other similar transfers so I didn't know I was on the hook for it. Thanks Nigel!! :-D The specific problem of running `apt-get update` before installing a package -- The requirement from Micah at [note 14](#note-14) might not be feasible: > I’m not sure what this solves except to make it so the exec is only run at > certain intervals, which is what cron-apt does. What we want puppet to do is > to run an apt-get update before a package is installed, not at random times, > and not at every run. The problem with this is that it would work for install but not for updates. apt would never know, due to the infinite lifetime of downloaded metadata, that there were upgrades available. So if there was a new metaparameter, or if the provider were twiddled to do apt-get update inside itself only if the ensure were found to be out of sync (as someone here proposed), it'd have to build logic to satisfy ANY of the following conditions: 1. if any package is specified to be present and isn't, then apt-get update 2. if any package is specified to be a particular version and there's an older installed version, then apt-get update 3. if any package is specified to be ensure=>latest, then apt-get update It's that last one that gets me. Some questions for the watchers: * are you (micah, alex hewson, etc) specifying every version for every package? * Do you do `ensure=>latest` anywhere? * There are a couple of comments about the load on mirrors; is it really that bad? (Not snark, I honestly don't know, I come from a redhat background and have had thousands of servers hitting metadata on repository servers at 30 minute intervals without negative affect, but that is only 3 files with if-modified-since headers so perhaps its much worse on apt servers) ---------------------------------------- Feature #3537: It should be possible to trigger (exec) resources with require https://projects.puppetlabs.com/issues/3537#change-91327 * 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
