2012/10/22 Calvin Walton <calvin.walton@kepstin.ca>
On Mon, 2012-10-22 at 10:28 +0200, Martin Willemsma wrote:
Hi All,

I was wondering if it is possible to NOT show an event in puppet
I have an exec resource that fires of a ruby script. This is triggering a
changed event on every run, but actually I want to exclude this from
showing up as "CHANGED"

Is this possible, if so how can I achieve this?
There's actually a trick you can do with the 'onlyif' and 'unless'
options to the exec type that can accomplish what you want. The expense
is that you no longer get log output from the command on failure:

exec {
"run_myscript" :
unless => "/usr/bin/env ruby ${my_script} ${csv_files}",
command => "/bin/false",
cwd => "${myscript_dir}",
timeout => 0,
logoutput => "on_failure",

(This will show up as an error in the puppet run if the command fails,
but not show up at all if it succeeds.)

However, you mentioned something about facts generation in a later post?
Do keep in mind that facts are uploaded to the puppet master *before*
any of the code in your manifest executes, so anything done in your
manifest will only affect the facts for the next puppet run.

Calvin Walton <calvin.walton@kepstin.ca>

Thank for this suggestion Calvin,

I'm uploading facts to the inventory as part of this manifest.

I have a bunch of files I want to monitor. This can be random files. I
created a small script in ruby to check the existence of those files and
check the current md5sum. If the sum is not in my log, or the file has been
added to the list of files that need to be monitored, that file is being
send to the puppet filebucket and the file plus sum is added as a customer

The last step in my script will do a `puppet facts upload --terminus
inventory_service --mode agent` if any of the files has been changed. This
trick is here just for the reason you mentioned. The facts are 'known' to
others in the next run. I need this information directly.

Thanks again for your hint. Will be the first thing I try tomorrow.

Kind Regards,

Martin Willemsma

You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 5 | next ›
Discussion Overview
grouppuppet-users @
postedOct 22, '12 at 8:28a
activeOct 24, '12 at 8:47p



site design / logo © 2022 Grokbase