On Wednesday, December 10, 2014 9:37:15 AM UTC-6, Spriya wrote:
>
> Hi,
>
> I tried to place a command  in exec statement. when the command is 
> executed successfully can we stop getting notice message. If the command in 
> exec statement fails then only i need to get notice messages. 
>
> Is there a way we can do that?
>
>
No and yes.  You must understand that Exec resources are not designed for 
general-purpose command running.  They can be *used* for that, but they are 
designed as a way to model resources for which no native type is 
available.  They follow the same model as all other resources: they are 
checked to determine whether they need to be synced, and if so then they 
are synced (by executing their `command'.  If they are synced, therefore, 
it is exactly as notable an event as if a resource of any other type is 
synced.

On the other hand, if you understand the above then you should now be 
considering how Puppet determines whether an Exec resource in fact needs to 
be synced.  This is the role of the 'onlyif', 'unless', and 'creates' 
parameters.  Very likely you can achieve something closer to what you're 
after, if not exactly what you're after, by incorporating these into your 
Exec usage.


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/3832f261-b237-4885-8117-fbb0bb66a5ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to