Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
with the next structure:
- vmHash: { vcpu: 1,
ram: 1024,
storage: 10,
vms: [{name: storage1-dev02,ip: 10.199.3.87},
{name: storage2-dev02,ip: 10.199.3.88},
{name: storage3-dev02,ip: 10.199.3.89}]
}
- name: send stuff2 to all ttys
shell: "echo 'sed -i '' 's/{{ goldenip }}/{{ item.ip }}/g' /cf/conf/config.xml' > /dev/pts/foo"
with_items: vmHash.vms
# - ntty.results
How to use with_together? I want to change, foo (on /dev/pts/foo) by the content of ntty.results. An approach is
- name: send stuff2 to all ttys
shell: "echo 'sed -i '' 's/{{ goldenip }}/{{ item.ip.0 }}/g' /cf/conf/config.xml' > /dev/pts/{{ item.1 }}"
with_items:
- vmHash.vms
- ntty.results
But it does not work. Thanks :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment