Skip to content

Instantly share code, notes, and snippets.

@omgjlk
Created August 27, 2014 19:05
Show Gist options
  • Save omgjlk/0a47ccdf8333c02aee17 to your computer and use it in GitHub Desktop.
Save omgjlk/0a47ccdf8333c02aee17 to your computer and use it in GitHub Desktop.
- name: derp
gather_facts: false
hosts: all
vars:
foo: bar
missing: derp
tasks:
- command: echo yes
when: foo.startswith('nope') or (missing is defined and missing.starts_with('derp'))
$ ansible-playbook -i derp, test.yaml -vv -c local
PLAY [derp] *******************************************************************
TASK: [command echo yes] ******************************************************
skipping: [derp]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment