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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 '15 at 3:45
up vote 4 down vote accepted

Go to:

Look at the section titled "Conditional Execution"

share|improve this answer
That no longer exists. – William Pietri Apr 28 '15 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.