Skip to content

Instantly share code, notes, and snippets.

@alexhayes
Last active April 9, 2017 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexhayes/c6312965a4133bebe54d69c2f668e465 to your computer and use it in GitHub Desktop.
Save alexhayes/c6312965a4133bebe54d69c2f668e465 to your computer and use it in GitHub Desktop.
Execute b if a is successful, otherwise execute c
a:
cmd.run:
- name: exit 0
b:
cmd.run:
- name: echo "Success"
- require:
- cmd: a
c:
cmd.run:
- name: echo "Failure"
- onfail:
- cmd: a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment