-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxen.yml
43 lines (43 loc) · 1.07 KB
/
xen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
- name: Setup Xen on Ubuntu
become: true
hosts: all
gather_facts: False
pre_tasks:
- name: Install python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
register: output
changed_when: output.stdout != ""
- setup: # aka gather_facts
tasks:
- name: Update & upgrade
apt:
update_cache: true
upgrade: dist
cache_valid_time: 3600
- name: Remove Guest Additions
apt:
name: virtualbox-guest-dkms
state: absent
autoremove: yes
- name: Install Xen
apt:
pkg: '{{ item }}'
state: present
with_items:
- git
- golang
- qemu-system-x86
- vim
- xen-hypervisor
- name: Reboot into Xen
shell: 'sleep 2 && shutdown -r now "Ansible updates triggered"'
async: 1
poll: 0
ignore_errors: yes
- name: Wait for server to come back
local_action: wait_for host="{{ inventory_hostname }}"
args:
state: started
delay: 10
become: false