Skip to content

Instantly share code, notes, and snippets.

@Pablohn26

Pablohn26/gist:8478488

Last active Jan 3, 2016
Embed
What would you like to do?
- name: getting tty
shell: virsh dumpxml {{ item.name }} | grep "tty=" | cut -d= -f3 | cut -d/ -f4 | cut -d\' -f1
#shell: virsh dumpxml log-dev02 | grep "tty=" | cut -d= -f3 | cut -d/ -f4 | cut -d\' -f1
with_items: vmHash.vms
register: ntty
- name: entering on the shell inside each tty
shell: "echo '6' > /dev/pts/{{ item.stdout }}"
with_items: ntty.results
- name: send stuff2 to all ttys
shell: "echo 'sed -i '' 's/{{ goldenip }}/{{ item.0 }}/g' /cf/conf/config.xml' > /dev/pts/{{ item.1 }}"
with_together:
- vmHash.vms.ip
- ntty.results
##########VARS##############
call: virt-install.yml vmHash=$vmStorage
- vmStorage: { 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}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment