Skip to content

Instantly share code, notes, and snippets.

@djmitche
Created March 27, 2016 22:44
Show Gist options
  • Save djmitche/c5b0fc490994ee91ff64 to your computer and use it in GitHub Desktop.
Save djmitche/c5b0fc490994ee91ff64 to your computer and use it in GitHub Desktop.
- hosts: all
connection: local
tasks:
- include: otherfile.yml
vars:
aa: "aa/{{item}}"
with_items:
- A
- B
- debug:
msg:
a: "{{aa}}"
it: "{{item}}"
with_items:
- I
- J
PLAY ***************************************************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [include] *****************************************************************
included: /home/dustin/tmp/nest-test/otherfile.yml for localhost
included: /home/dustin/tmp/nest-test/otherfile.yml for localhost
TASK [debug] *******************************************************************
ok: [localhost] => (item=I) => {
"item": "I",
"msg": {
"a": "aa/I",
"it": "I"
}
}
ok: [localhost] => (item=J) => {
"item": "J",
"msg": {
"a": "aa/J",
"it": "J"
}
}
TASK [debug] *******************************************************************
ok: [localhost] => (item=I) => {
"item": "I",
"msg": {
"a": "aa/I",
"it": "I"
}
}
ok: [localhost] => (item=J) => {
"item": "J",
"msg": {
"a": "aa/J",
"it": "J"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment