Create a gist now

Instantly share code, notes, and snippets.

@phips /main.yaml Secret
Created Sep 30, 2013

What would you like to do?
Installing XenTools with Ansible
- name: Fetch tools install
url=http://{{ bootstrap_svr }}/{{ bootstrap_dir }}/{{ xentools }}
dest={{ tmp }}
when: not (ansible_local.xentools.installed is defined)
register: fetch
- name: Unarchive tools dist
shell: "tar xzf {{ tmp }}{{ xentools }} -C {{ tmp }}"
when: fetch.changed
- name: Check for archive
stat: path={{ tmp }}{{ xentools }}
register: archive
- name: Installing tools
shell: "{{ tmp }}xenhvm-tools/ -n"
when: archive.stat.exists and not (ansible_local.xentools.installed is defined)
ignore_errors: true
- name: Remove temporary files
shell: "rm -rf {{ tmp }}{{ xentools }}"
when: archive.stat.exists
- name: Ensure facts directory exists
file: path=/etc/ansible/facts.d
state=directory owner=root group=root mode=0755
- name: Setup fact
copy: src=xentools.fact dest=/etc/ansible/facts.d/ mode=0755
tmp: '/var/tmp/'
bootstrap_svr: 'build.lan'
bootstrap_dir: '/bootstrap'
xentools: 'xenhvm-tools.tgz'
if [[ -x $XEDAEMON ]]; then
echo '{"installed":true}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment