hi all,
i'm new to ansible... i 'm having issues with looping with this set of data
with with_items
ok: [host1] => {"ansible_facts": {"foo": "[u'app1 app2', u'app1,app2']"}}
ok: [host2] => {"ansible_facts": {"foo": "[u'app1 app2', u'app1 app2']"}}
ok: [host3] => {"ansible_facts": {"foo": "[u'app1 app2']"}}
ok: [host4] => {"ansible_facts": {"foo": "[u'app1 app2']"}}
- name: make a list
set_fact: foo="{{ foo_result.results |
map(attribute='ansible_facts.foo_item') | list }}"
# - debug: var=foo
- name: test list with k v
shell: echo {{ item.apphome }} >
/tmp/{{inventory_hostname}}_var.txt;cmd {{ item }} >
/tmp/{{inventory_hostname}}_result.txt
with_items:
- "{{ foo_item }}"
# - debug: var=foo_item
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5200e3a2-a5bf-4a72-a72e-24434dc50d2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.