I am running shell command in my playbook to extract the results of a command. The output of
- debug: msg="{{ dblist.stdout_lines }}"
is
ok: [host] => {
"msg": [
"inst1:db1"
"inst1:db2"
"inst1:db3"
"inst2:db4"
"inst2:db3"
]
}
I need to store this value in a format that allows me to run my next playbook considering the value of item.0 as inst1 and item.1 as db2 and so on.
Currently
- debug: msg="{{ item.0 }} has a value {{ item.1 }}"
with_items: "{{ dblist.stdout_lines }}"
is giving values like
ok: [host] => (item=inst1:db1) => {
"msg": "i has a value n"
}
ok: [host] => (item=inst1:db2) => {
"msg": "i has a value n"
Thanks.