Skip to content

Instantly share code, notes, and snippets.

@kormat
Last active July 20, 2017 08:28
Show Gist options
  • Save kormat/56ef242aae3b7e77147688f9959d199d to your computer and use it in GitHub Desktop.
Save kormat/56ef242aae3b7e77147688f9959d199d to your computer and use it in GitHub Desktop.
- hosts: localhost
tasks:
- include: task1.yml
- include: task1.yml arg={{ blah|default(omit) }}
$ ansible-playbook omit_placeholder.yml -l localhost
PLAY [localhost] *****************************************************************************************************************************************************************************
TASK [Gathering Facts] ***********************************************************************************************************************************************************************
ok: [localhost]
TASK [debug] *********************************************************************************************************************************************************************************
ok: [localhost] => {
"msg": "task1 included"
}
TASK [debug] *********************************************************************************************************************************************************************************
skipping: [localhost]
TASK [debug] *********************************************************************************************************************************************************************************
ok: [localhost] => {
"msg": "task1 included"
}
TASK [debug] *********************************************************************************************************************************************************************************
ok: [localhost] => {
"msg": "task2 included arg=__omit_place_holder__7623bf129fadd0e0233ebe365031ad078f31facd"
}
PLAY RECAP ***********************************************************************************************************************************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=0
- debug: msg="task1 included"
- include: task2.yml
when: arg is defined
- debug: msg="task2 included arg={{arg}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment