Skip to content

Instantly share code, notes, and snippets.

@tgerla
Created October 17, 2013 22:28
Show Gist options
  • Select an option

  • Save tgerla/7033443 to your computer and use it in GitHub Desktop.

Select an option

Save tgerla/7033443 to your computer and use it in GitHub Desktop.
Timothys-MacBook-Pro:ansible-test tgerla$ ansible-playbook -i localhost, test-includes.yml -e myvar=this
PLAY [localhost] **************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [debug msg=hi] **********************************************************
skipping: [localhost]
PLAY RECAP ********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0
Timothys-MacBook-Pro:ansible-test tgerla$ ansible-playbook -i localhost, test-includes.yml -e myvar=that
PLAY [localhost] **************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [debug msg=hi] **********************************************************
ok: [localhost] => {
"item": "",
"msg": "hi"
}
PLAY RECAP ********************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0
Timothys-MacBook-Pro:ansible-test tgerla$
- debug: msg=hi
---
- hosts: localhost
connection: local
tasks:
- include: includes.yml
when: myvar == "that"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment