Issue #3149 has been updated by Hari Sekhon.

Status changed from Closed to Re-opened

The unless param to the exec resource does not quite cover it.

For example, I want to trigger a service restart using the service resource, 
otherwise how am I supposed to know the correct path to the init script, since 
init scripts are different on different distros, the service construct could 
have this information, and I just want to trigger a refresh on it only on 
failure of an exec.

Having this as a meta parameter would be very useful since one could then have 
the option of getting other resources to trigger either on success or on 
failure, whereas at the moment we can only do this on success, which means in 
the exec example, one would have to ! the command line, littering the logs with 
failures and ruining reporting.
----------------------------------------
Feature #3149: notify => to trigger another resource only on failure of the 
current resource
http://projects.reductivelabs.com/issues/3149

Author: Hari Sekhon
Status: Re-opened
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 0.24.8
Keywords: 
Branch: 


I have a resource that I expect to run successfully all the time, and when it's 
not I want it to trigger the run of another resource that otherwise wouldn't 
run.

Basically inverting the success/failure criteria of a notify =>

What I used to do was have a time check exec, and negated the command, with a 
notify such that if the command actually failed (ie the time was out of sync by 
more than a few seconds) it would return success to puppet and that would 
trigger the notify => of another resource to fix the time.

However, once one starts doing reporting, this is not cool since it means that 
resource fails on every run on every machine from puppet's perspective and was 
really not a nice hack. It also litters the logs.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

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

Reply via email to