Run Exec without notifying Puppet as a change

289 views
Skip to first unread message

Thomas Biddle

unread,
Nov 5, 2012, 4:03:57 PM11/5/12
to puppet...@googlegroups.com
I just switched from an in-house APT module to the Puppetlabs one thinking that it may solve this, but after looking at the code (And installing to confirm) it did not.

Seeing Puppet be notified of a "change" just when `apt-get update` is run is a bit annoying to me. I was wondering if there was a way to avoid notifying Puppet of a change when an Exec command is run? (Or if there's another way we can run this)

TJ

llowder

unread,
Nov 5, 2012, 5:00:30 PM11/5/12
to puppet...@googlegroups.com

ONly way I know of is to use a fake exec (calling /bin/true or /bin/false (so it'll raise an error if it does get called) or something like that.) and use an only if with the real command (the update).

jcbollinger

unread,
Nov 6, 2012, 9:48:13 AM11/6/12
to puppet...@googlegroups.com


On Monday, November 5, 2012 3:03:57 PM UTC-6, Thomas Biddle wrote:
I just switched from an in-house APT module to the Puppetlabs one thinking that it may solve this, but after looking at the code (And installing to confirm) it did not.

Seeing Puppet be notified of a "change" just when `apt-get update` is run is a bit annoying to me. I was wondering if there was a way to avoid notifying Puppet of a change when an Exec command is run? (Or if there's another way we can run this)


It is a change.  The system goes from a state of 'apt-get update' not having been run (in some given time frame) to a state in which it has been run.  That's the way it works for Execs.

In general, what you can do is use one or more of the Exec's 'unless', 'onlyif', or 'creates' properties to define whether the Exec needs to run at all, and / or you can set "refreshonly => true" so that it has to receive an event from some other resource before it will run.  You can also set a schedule on it to reduce the frequency at which it is applied.  You will have to judge for yourself whether any of those alternatives is applicable to your particular situation.


John

Reply all
Reply to author
Forward
0 new messages