Created
October 23, 2014 00:29
-
-
Save jpic/d7769dbbeb2262f2a29b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[foo] | |
hosta ansible_ssh_host=localhost kvm=kvma ansible_python_interpreter=/usr/bin/python2 | |
hostb ansible_ssh_host=localhost kvm=kvmb ansible_python_interpreter=/usr/bin/python2 | |
[kvm] | |
kvma ansible_ssh_host=localhost ansible_python_interpreter=/usr/bin/python2 | |
kvmb ansible_ssh_host=localhost ansible_python_interpreter=/usr/bin/python2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: foo | |
serial: 1 | |
vars: | |
snapshot_name: "MEP-{{ ansible_date_time['date'] }}-{{ ansible_date_time['time'] }}" | |
kvm: "{{ hostvars[inventory_hostname]['kvm'] }}" | |
tasks: | |
- name: do something on the kvm hosting the vm | |
shell: echo domain={{ inventory_hostname }} kvm={{ kvm }} snapshot_name={{ snapshot_name }} | |
delegate_to: "{{ kvm }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment