Skip to content

Instantly share code, notes, and snippets.

@jrisch
Created November 30, 2017 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrisch/28322a40d5b370643873c36881e5466b to your computer and use it in GitHub Desktop.
Save jrisch/28322a40d5b370643873c36881e5466b to your computer and use it in GitHub Desktop.
- name: Insert Xentools CD in CDROM drive
command: xe vm-cd-insert cd-name=xs-tools.iso vm={{ vmuuid.stdout }}
when: ansible_distribution_major_version|int <= 6
- name: Insert Xentools CD in CDROM drive
command: xe vm-cd-insert cd-name=guest-tools.iso vm={{ vmuuid.stdout }}
when: ansible_distribution_major_version|int >= 7
- name: Get the last boot time for the VM
command: xe vm-param-get param-name=start-time uuid={{ vmuuid.stdout}}
register: boottime
- name: Watch for the last reboot
shell: export starttime={{ boottime.stdout }}; while [[ ${starttime} == {{ boottime.stdout }} ]]; do sleep 15; starttime=`xe vm-param-get param-name=start-time uuid={{ vmuuid.stdout }}`; done
async: 1800
poll: 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment