Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'd like to create an execute block which is only run when some specific condition is met (in this case if an interface wlan0 is present). Alternatively, I'd like to prevent the notifies clause of a template on the same condition.

How can I describe that in a recipe? I could of course put the whole condition in the execute's command, but I hope there's a better way to achieve this...

share|improve this question
The 'guards' 'not_if' and 'only_if' will only execute a resource if a script returns true. –  spuder Jun 13 at 3:45

1 Answer 1

up vote 3 down vote accepted

Go to:

Look at the section titled "Conditional Execution"

share|improve this answer
That no longer exists. –  William Pietri Apr 28 at 18:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.