On 28 Jul 2014 23:56, "Dimitris Stafylarakis" <[email protected]> wrote: > > Hi people, > > thanks for your replies. My actual case is run apt-get update before upgrading a package. So I have packages in my own repository and I'm managing them through puppet on the production server. I want to be able to set a specific version number and have puppet install the right version of the package on the server. > > @pete: actually I am using puppetlabs/apt. It works fine when a new package is being installed but for some reason doesn't trigger an update when upgrading a package (i.e., changing the version number in the ensure parameter).
There is an option in the apt module to run apt-get update before every install but I am guessing you found that one. There might be a setting for how often an update gets run. Have you considered wrapping package in a define that does an update before the install and using that for your local package installs? You could also setup a cron to do an apt-get update at regular intervals. And now I think about it you could probably setup some kind of trigger in you local repo updated that trigger a mcollective to do the update. > > @john: I understand that it's difficult to determine a priori which resources will be refreshed, I was just asking in case someone found a smart solution to this already. For now, I have to resolve to running updates on every puppet run. > > Thanks anyway > > cheers, > Dimitris > > > On Friday, July 25, 2014 5:20:48 PM UTC+2, jcbollinger wrote: >> >> >> >> On Thursday, July 24, 2014 10:42:34 AM UTC-5, Dimitris Stafylarakis wrote: >>> >>> Hi all, >>> >>> I have a question for the experts in the group: >>> >>> say there's an exec resource dependent on some other resource and refreshonly=> true. As we know already, a change in the dependent resource will send a refresh event to the exec resource. This will however be scheduled for AFTER the change in the dependent resource (e.g. change a configuration file for apache and then reload the service). I'd like to know if it's possible to schedule the exec resource BEFORE the change (e.g. run apt-get update before upgrading a package). >> >> >> >> No, it's not logically consistent. If you want a resource A to be refreshed in the event that a different resource, B, is changed, then Puppet needs to sync B before it knows whether to refresh A. >> >> Under some circumstances you can use Exec's 'onlyif' and/or 'unless' parameter instead of 'refreshonly' and events. Alternatively, you may be able to use custom facts to help predict whether a specific resource will be updated. Details may depend on exactly what you're trying to do. >> >> >> John >> > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c7991131-546e-4515-9ffb-2da1eb1e2605%40googlegroups.com . > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJ8DPF6%3Di%2BrgP%2B4cy0i2XxsoqvXLWJdc-R7mTNb%3DD4TifRXb5w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
