Installing XenTools with Ansible
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
--- | |
- name: Fetch tools install | |
get_url: | |
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/install.sh -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 |
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
--- | |
tmp: '/var/tmp/' | |
bootstrap_svr: 'build.lan' | |
bootstrap_dir: '/bootstrap' | |
xentools: 'xenhvm-tools.tgz' |
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
#!/bin/bash | |
XEDAEMON='/usr/sbin/xe-daemon' | |
if [[ -x $XEDAEMON ]]; then | |
echo '{"installed":true}' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment