Skip to content

Commit ec239a3

Browse files
committed
Start breaking playbook up into roles
1 parent ce80800 commit ec239a3

File tree

12 files changed

+55
-38
lines changed

12 files changed

+55
-38
lines changed

ansible/playbook.yaml

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
- mlocate
4646
- lighttpd
4747
- lighttpd-mod-magnet
48-
- munin-node
4948
- nagios-nrpe-server
5049
- pacemaker
5150
- pacemaker-cli-utils
@@ -62,20 +61,14 @@
6261
command: "true"
6362
notify:
6463
- reboot
65-
- munin reconfigure
64+
- reconfigure munin-node
6665
- setup
66+
roles:
67+
- ldirectord-status
68+
- lvs-iptables
69+
- lvs-lighttpd
70+
- munin-node
6771
tasks:
68-
- include_role: name=ldirectord-status
69-
- include_role: name=lvs-iptables
70-
- name: Configure munin
71-
blockinfile:
72-
path: /etc/munin/munin-node.conf
73-
block: |
74-
allow ^127\.0\.0\.1$
75-
allow ^18\.187\.1\.128$
76-
allow ^18\.181\.0\.65$
77-
allow ^18\.181\.0\.51$
78-
notify: restart munin-node
7972
- name: Install munin cps plugin
8073
copy:
8174
dest: /etc/munin/plugins/cps_1_0
@@ -117,24 +110,6 @@
117110
regexp: '^root:'
118111
line: "root: {{ root_aliases|join(', ') }}"
119112
notify: newaliases
120-
- name: Install /etc/lighttpd/scripts-maint
121-
synchronize:
122-
dest: /etc/lighttpd/scripts-maint/
123-
src: files/scripts-maint/
124-
archive: no
125-
checksum: yes
126-
delete: yes
127-
recursive: yes
128-
use_ssh_args: yes
129-
- name: Install /etc/lighttpd/scripts-maint.lua
130-
copy:
131-
dest: /etc/lighttpd/scripts-maint.lua
132-
src: files/scripts-maint.lua
133-
- name: Configure lighttpd
134-
copy:
135-
dest: /etc/lighttpd/lighttpd.conf
136-
src: files/scripts-maint-lighttpd.conf
137-
notify: restart lighttpd
138113
- name: Load IPVS modules
139114
copy:
140115
dest: /etc/modules-load.d/lvs.conf
@@ -189,8 +164,6 @@
189164
handlers:
190165
- name: newaliases
191166
command: newaliases
192-
- name: restart lighttpd
193-
service: name=lighttpd state=restarted
194167
- name: load modules
195168
service: name=systemd-modules-load state=restarted
196169
- name: reload sysctl
@@ -199,11 +172,6 @@
199172
service: name=ipvsadm state=restarted
200173
- name: reboot
201174
include_tasks: reboot.yaml
202-
- name: munin reconfigure
203-
shell: munin-node-configure --suggest --shell --remove-also | sh
204-
notify: restart munin-node
205-
- name: restart munin-node
206-
service: name=munin-node state=restarted
207175
- name: restart nrpe
208176
service: name=nagios-nrpe-server state=restarted
209177
- name: setup
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- name: restart lighttpd
3+
service: name=lighttpd state=restarted
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
- name: Install packages
3+
apt:
4+
name: "{{ item }}"
5+
state: present
6+
with_items:
7+
- lighttpd
8+
- lighttpd-mod-magnet
9+
- name: Install /etc/lighttpd/scripts-maint
10+
synchronize:
11+
dest: /etc/lighttpd/scripts-maint/
12+
src: scripts-maint/
13+
archive: no
14+
checksum: yes
15+
delete: yes
16+
recursive: yes
17+
use_ssh_args: yes
18+
- name: Install /etc/lighttpd/scripts-maint.lua
19+
copy:
20+
dest: /etc/lighttpd/scripts-maint.lua
21+
src: scripts-maint.lua
22+
- name: Configure lighttpd
23+
copy:
24+
dest: /etc/lighttpd/lighttpd.conf
25+
src: scripts-maint-lighttpd.conf
26+
notify: restart lighttpd

0 commit comments

Comments
 (0)