-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathganglia.yml
171 lines (147 loc) · 3.68 KB
/
ganglia.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#
# Ganglia cluster monitor
#
# TODO: monitor cleanup mysql
---
- hosts: all
vars_files:
- ganglia_vars.yml
- networks.yml
- [ "vars/{{ ansible_os_family }}.yml", "vars/Defaults.yml" ]
tasks:
### REDHAT
- name: Install ganglia packages
yum: name=$item
state=installed
with_items:
- ganglia
- ganglia-gmetad
- ganglia-gmond
- ganglia-gmond-python
- ganglia-web
- libnodeupdown-backend-ganglia
when: ansible_os_family == "RedHat"
tags:
- packages
### DEBIAN
- name: Install Ganglia repo
apt_repository: repo='deb http://ppa.launchpad.net/rufustfirefly/ganglia/ubuntu precise main'
when: ansible_os_family == "Debian"
tags:
- packages
- repo
- name: Install ganglia packages
apt: name=$item
state=installed
with_items:
- ganglia-monitor
- ganglia-monitor-python
- ganglia-modules-linux
- ganglia-webfrontend
- gmetad
when: ansible_os_family == "Debian"
tags:
- packages
### MODULES
- name: Download community python modules
git: repo=$python_modules_git
dest=$python_modules_dir
tags:
- modules
### CONFIGURATION
# TODO: ipmi monitoring
# TODO: multicast test and firewall
# - name: Add multicast route
# command: /sbin/route add -host ${mcast_addr} dev ${mcast_dev}
- name: Ganglia monitor
template: src=etc/ganglia/gmond.conf.j2
dest=/etc/ganglia/gmond.conf
owner=root
group=root
mode=0644
notify:
- Restart gmond
tags:
- config
- name: Ganglia meta-data
template: src=etc/ganglia/gmetad.conf.j2
dest=/etc/ganglia/gmetad.conf
owner=root
group=root
mode=0644
notify:
- Restart gmetad
tags:
- config
- name: Disable tcpconn.pyconf
template: src=etc/ganglia/conf.d/tcpconn.pyconf.j2
dest=/etc/ganglia/conf.d/tcpconn.pyconf
owner=root
group=root
mode=0644
notify:
- Restart gmond
tags:
- config
- name: Enable Ganglia web interface
template: src=etc/httpd/conf.d/ganglia.conf.j2
dest=/etc/{{service_httpd}}/conf.d/ganglia.conf
owner=root
group=root
mode=0644
notify:
- Restart httpd
tags:
- config
- name: Enable motd service
lineinfile: dest=/etc/services
regexp="^gmond 8649/$item"
line="gmond 8649/$item"
with_items:
- tcp
- udp
tags:
- config
- services
- name: Enable gmetad-xml service
lineinfile: dest=/etc/services
regexp="^gmetad-xml 8651/$item"
line="gmetad-xml 8651/$item"
with_items:
- tcp
- udp
tags:
- config
- services
- name: Enable gmetad-int service
lineinfile: dest=/etc/services
regexp="^gmetad-int 8652/$item"
line="gmetad-int 8652/$item"
with_items:
- tcp
- udp
tags:
- config
- services
- name: Start gmond
service: name={{service_gmond}}
state=started
enabled=yes
- name: Start gmetad
service: name=gmetad
state=started
enabled=yes
- name: Start httpd
service: name={{service_httpd}}
state=started
enabled=yes
handlers:
- name: Restart gmond
service: name={{service_gmond}}
state=restarted
- name: Restart gmetad
service: name=gmetad
state=restarted
- name: Restart httpd
service: name={{service_httpd}}
state=restarted