$ ansible-playbook playbook_loop_adv1.yml
PLAY [a advanced loop with playbook] *******************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [print loop message] ******************************************************
ok: [localhost] => (item={u'num': u'0', u'str': u'automate'}) => {
"item": {
"num": "0",
"str": "automate"
},
"msg": "Loop 0: automate"
}
ok: [localhost] => (item={u'num': u'1', u'str': u'with'}) => {
"item": {
"num": "1",
"str": "with"
},
"msg": "Loop 1: with"
}
ok: [localhost] => (item={u'num': u'2', u'str': u'ansible'}) => {
"item": {
"num": "2",
"str": "ansible"
},
"msg": "Loop 2: ansible"
}
PLAY RECAP *********************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0