-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.yml
264 lines (203 loc) · 6.97 KB
/
site.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
---
- name: Install Some Packets on Ansible Server
hosts: localhost
gather_facts: no
tasks:
- name: Install Packets
yum: name={{item}} state=installed
with_items:
- sshpass
- name: Init Centos OS Bases
hosts: all
gather_facts: no
roles:
- { role: base }
- { role: bond, when: ENABLE_BOND | bool == true }
tags: init_centos
- name: Init Centos OpenStack Bases
hosts: all
gather_facts: no
roles:
- { role: openstack_base }
- name: Install LB
hosts: cloud-loadbalance
gather_facts: no
roles:
- { role: pacemaker, when: ENABLE_PACEMAKER | bool == true }
tags: pacemaker_deploy
- name: Install Ceph Mons And Mgrs
hosts: cloud-mon
gather_facts: no
roles:
- { role: ceph_common, when: ENABLE_CEPH | bool == true }
- { role: ceph_mon, when: ENABLE_CEPH | bool == true }
- { role: ceph_mgr, when: ENABLE_CEPH | bool == true }
tags: ceph_mon_deploy
- name: Install Ceph Osds
hosts: cloud-osd
gather_facts: no
roles:
- { role: ceph_common, when: ENABLE_CEPH | bool == true }
- { role: ceph_osd, when: ENABLE_CEPH | bool == true }
tags: ceph_osd_deploy
- name: Create Pools For Openstack
hosts: cloud-compute,cloud-controller,cloud-storage
gather_facts: no
roles:
- { role: ceph_common, when: ENABLE_CEPH | bool == true }
- { role: ceph_openstack, when: ENABLE_CEPH | bool == true }
- name: Install Memcache
hosts: cloud-memcache
gather_facts: no
roles:
- { role: memcache, when: ENABLE_OPENSTACK | bool == true and ENABLE_MEMCACHED | bool == true }
tags: memcache_deploy
- name: Install Mariadb
hosts: cloud-database
gather_facts: no
roles:
- { role: mariadb_cluster, when: ENABLE_OPENSTACK | bool == true and ENABLE_MYSQL | bool == true }
tags: mariadb_cluster_deploy
- name: Install Rabbitmq
hosts: cloud-ampq
gather_facts: no
roles:
- { role: rabbitmq_cluster, when: ENABLE_OPENSTACK | bool == true and ENABLE_RABBITMQ | bool == true }
tags: rabbitmq_cluster_deploy
- name: Install Keystone Glance Neutron On Controller Nodes
hosts: cloud-controller
gather_facts: no
roles:
- { role: keystone, when: ENABLE_OPENSTACK | bool == true and ENABLE_KEYSTONE | bool == true }
- { role: glance, when: ENABLE_OPENSTACK | bool == true and ENABLE_GLANCE | bool == true }
- { role: neutron, when: ENABLE_OPENSTACK | bool == true and ENABLE_NEUTRON | bool == true }
tags: openstack_controller_deploy
- name: Install Network Agents On Network Nodes
hosts: cloud-network
gather_facts: no
roles:
- { role: neutron_dhcp_agent, when: ENABLE_OPENSTACK | bool == true and ENABLE_NEUTRON | bool == true }
- { role: neutron_l3_agent, when: ENABLE_OPENSTACK | bool == true and ENABLE_NEUTRON | bool == true }
- { role: neutron_metadata_agent, when: ENABLE_OPENSTACK | bool == true and ENABLE_NEUTRON | bool == true }
- { role: neutron_openvswitch_agent, when: ENABLE_OPENSTACK | bool == true and ENABLE_NEUTRON | bool == true }
- { role: neutron_lbaas_agent, when: ENABLE_LBAAS | bool == true and ENABLE_OPENSTACK | bool == true and ENABLE_NEUTRON | bool == true }
tags: neutron_agents_deploy
- name: Install Network Agent On Compute Nodes
hosts: cloud-compute
gather_facts: no
roles:
- { role: neutron_openvswitch_agent, when: ENABLE_OPENSTACK | bool == true and ENABLE_NEUTRON | bool == true }
tags: neutron_openvswitch_agent_deploy
- name: Install Cinder On Controller Nodes
hosts: cloud-controller
gather_facts: yes
roles:
- { role: cinder, when: ENABLE_OPENSTACK | bool == true and ENABLE_CINDER | bool == true }
tags: cinder_controller_deploy
- name: Install Cinder On Storage Nodes
hosts: cloud-storage
gather_facts: yes
roles:
- { role: cinder_volume, when: ENABLE_OPENSTACK | bool == true and ENABLE_CINDER | bool == true }
tags: cinder_volume_deploy
- name: Install Nova On Controller Nodes
hosts: cloud-controller
gather_facts: no
roles:
- { role: nova, when: ENABLE_OPENSTACK | bool == true and ENABLE_NOVA | bool == true }
tags: nova_controller_deploy
- name: Install Nova On Compute Nodes
hosts: cloud-compute
gather_facts: no
roles:
- { role: nova_compute, when: ENABLE_OPENSTACK | bool == true and ENABLE_NOVA | bool == true }
tags: nova_compute_deploy
- name: Install Dashboard On Controller Nodes
hosts: cloud-controller
gather_facts: no
roles:
- { role: horizon, when: ENABLE_OPENSTACK | bool == true and ENABLE_HORIZON | bool == true }
tags: horizon_deploy
- name: Fix Openstack Bugs
hosts: all
gather_facts: no
roles:
- { role: openstack_bugs_fix, when: ENABLE_OPENSTACK | bool == true and ENABLE_OPENSTACK_BUGS_FIX | bool == true }
tags: openstack_bugs_fix
- name: Deploy Zabbix Server
hosts: cloud-monitor
roles:
- { role: zabbix_server, when: ENABLE_ZABBIX | bool == true }
tags: zabbix_server_deploy
- name: Deploy Zabbix Agent
hosts: all
roles:
- { role: zabbix_agent, when: ENABLE_ZABBIX | bool == true }
tags: zabbix_agent_deploy
- name: Deploy influxdb chronograf kapacitor
hosts: "cloud-monitor"
gather_facts: no
roles:
- { role: influxdb, when: ENABLE_INFLUXDATA | bool == true }
tags: influxdb_deploy
- name: Deploy telegraf
hosts: all
gather_facts: no
roles:
- { role: telegraf, when: ENABLE_INFLUXDATA | bool == true }
tags: telegraf_deploy
- name: Deploy grafana
hosts: "cloud-monitor"
gather_facts: no
roles:
- { role: grafana, when: ENABLE_GRAFANA | bool == true }
tags: grafana_deploy
- name: Deploy prometheus
hosts: "cloud-monitor"
gather_facts: yes
roles:
- { role: prometheus, when: ENABLE_PROMETHEUS | bool == true }
tags: prometheus_deploy
- name: Deploy consul
hosts: "cloud-consul"
gather_facts: true
roles:
- { role: consul, when: CONSUL_ENABLED | bool == true }
tags: consul_deploy
- name: Deploy node-exporter on all nodes exclude k8s groups
#hosts: "all:!k8s"
hosts: "all"
gather_facts: true
roles:
- { role: node-exporter, when: NODE_EXPORTER_ENABLED }
tags: node-exporter_deploy
- name: Deploy mysqld-exporter on all mysql nodes
hosts: "cloud-database"
gather_facts: true
roles:
- { role: mysqld-exporter, when: MYSQLD_EXPORTER_ENABLED }
tags: mysqld-exporter_deploy
- name: Deploy redis-exporter on all redis nodes
hosts: "cloud-redis"
gather_facts: true
roles:
- { role: redis-exporter, when: REDIS_EXPORTER_ENABLED }
tags: redis-exporter_deploy
- name: Deploy haproxy-exporter on all haproxy nodes
hosts: "cloud-loadbalance"
gather_facts: true
roles:
- { role: haproxy-exporter, when: HAPROXY_EXPORTER_ENABLED }
tags: haproxy-exporter_deploy
- name: Deploy memcached-exporter on all memcache nodes
hosts: "cloud-memcache"
gather_facts: true
roles:
- { role: memcached-exporter, when: MEMCACHED_EXPORTER_ENABLED }
tags: memcached-exporter_deploy
- name: Deploy ELK
hosts: "cloud-monitor"
gather_facts: no
roles:
- { role: elasticsearch, when: ENABLE_ELKSTACK| bool == true }
tags: elk_deploy