-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprepare_host.yaml
71 lines (65 loc) · 1.67 KB
/
prepare_host.yaml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
- hosts: vm_hosts
roles:
- role: ssh_server
vars:
management_vlan: 9
virtual_machine_vlan: 13
tasks:
- name: install lxc related packages
apt:
name: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- lxc
- python
- python-lxc
- name: install common lxc filesystem support
apt:
name: xfsprogs
state: present
- name: install network bridge utilities
apt:
name: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- bridge-utils
- vlan
notify: restart networking
# We should fix this bug. We really should. It's a bug.
# Bridge-utils requires a complete system reboot to enable the new bridge.
- name: configure network bridge with vlans
template:
src: templates/interfaces.j2
dest: /etc/network/interfaces
notify: restart networking
- name: install utilities
apt:
name: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- vim
- htop
- name: enable lvm wipe signature
lineinfile:
dest: /etc/lvm/lvm.conf
state: present
line: " wipe_signatures_when_zeroing_new_lvs = 0"
regexp: '^\s*.+wipe_signatures_when_zeroing_new_lvs = '
notify: restart lvm
handlers:
- name: restart networking
service:
name: networking
state: restarted
- name: restart lvm
shell: /etc/init.d/lvm2 reload
- hosts: status
roles:
- role: icinga2-monitoring