On Mon, Jul 28, 2014 at 06:56:08AM -0700, Dimitris Stafylarakis 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.

In this situation I've tended to go for the least intelligent solution, doing 
this on every agent run:

apt-get clean
apt-get update

That said, I've tended to leave ensure=>present for packages and make sure that 
the versions I want are what I would get from "apt-get install packagename", 
rather than fight with specific deb versions and dependencies. (YMMV, 
obviously.)

>    @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).
> 
>    @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 [1][email protected].
>    To view this discussion on the web visit
>    
> [2]https://groups.google.com/d/msgid/puppet-users/c7991131-546e-4515-9ffb-2da1eb1e2605%40googlegroups.com.
>    For more options, visit [3]https://groups.google.com/d/optout.
> 
> References
> 
>    Visible links
>    1. mailto:[email protected]
>    2. 
> https://groups.google.com/d/msgid/puppet-users/c7991131-546e-4515-9ffb-2da1eb1e2605%40googlegroups.com?utm_medium=email&utm_source=footer
>    3. 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/20140728150342.GA29208%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.

Reply via email to