[Puppet Users] Re: howto trigger action on another client

jcbollinger
Mon, 27 Jun 2011 22:33:46 -0000

On Jun 27, 9:37 am, Andreas Kuntzagk <andreas.kuntz...@mdc-berlin.de>
wrote:
> Thanks for these infos. I think I got at least a vague idea how this works
and
> can already use it for some simple cases.
> One more question:
> If I define checks for the "exported exec" (like
"creates" or "onlyif" will
> these run on the exporting agent or the executing agent? (my guess is the
second
> but want to make sure)


The ''unless'' and / or ''onlyif'' command will
run on the same nodes that
the main command runs on.  Likewise the criterion implied by the
''creates'' parameter is evaluated on the same nodes that the
main
command runs on.  In all cases, that means these apply to the node(s)
that *collect* the Exec resources.


> If this is the case is there a way to run the "exec" depending on
some checks on
> the exporting agent?


Certainly.  Define one or more custom facts embodying the results of
your tests (it''s pretty easy).  Distribute these via Puppet''s
pluginsync mechanism.  Use conditionals based on the fact values to
control whether the Exec''s are exported, and / or to vary their
parameters (e.g. setting unless => ''/bin/true'' is one way
for the
exporter to disable execution).

In general, facts, including custom facts, are the Puppet means for
providing nodes'' state details to the puppetmaster.


John