forked from trustedanalytics/platform-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
206 lines (183 loc) · 5.18 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
# Copyright (c) 2015 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
- hosts: cdh-all
gather_facts: no
any_errors_fatal: true
tasks:
- local_action: wait_for port=22 host={{ ansible_ssh_host }} search_regex=OpenSSH delay=10
- hosts: cdh-all
vars_files:
- defaults/cdh.yml
- defaults/yum_repos.yml
- defaults/proxy.yml
roles:
- { role: common, when: ansible_os_family == "RedHat" }
#install consul agent on the master machines
- hosts: cdh-master
vars_files:
- defaults/consul.yml
- defaults/proxy.yml
- defaults/env.yml
roles:
- { role: hostnames_common, when: use_custom_dns }
- { role: consul_base_agent, tags: skip_on_one_node_install }
- { role: consul_base_server, tags: skip_on_one_node_install }
#change hostnames to ones that are like the inv-names
- hosts: cdh-all
vars_files:
- defaults/consul.yml
- defaults/proxy.yml
- defaults/env.yml
roles:
- { role: hostnames_common, when: use_custom_dns }
- { role: resolv_common, when: use_custom_dns }
#install consul agents on all hosts
- hosts: cdh-all
vars_files:
- defaults/consul.yml
- defaults/proxy.yml
- defaults/env.yml
roles:
- { role: consul_base_agent, when: use_custom_dns }
#install a LB for CF
- include: nginx.yml
#install zabbix repos
- hosts: cdh-all
vars_files:
- defaults/zabbix.yml
- defaults/proxy.yml
pre_tasks:
- name: set server to zabbix proxy on consul node if any exists
set_fact:
zabbix_server_group: cdh-master
when: groups.has_key('cdh-master')
- name: set server to zabbix server if consul does not exist
set_fact:
zabbix_server_group: zabbix-server
when: not groups.has_key('cdh-master')
- name: set agent config to a simpler vagrant one
set_fact:
zabbix_agent_conf: "{{ zabbix_agent_conf_vagrant }}"
when: ansible_env.SUDO_USER == "vagrant"
roles:
#disabled on Openstack
- { role: zabbix_base_agent, when: ansible_virtualization_type != 'NA' and ansible_os_family == "RedHat" }
#install all base packages needed on cloudera machines
- hosts: cdh-all
vars_files:
- defaults/cdh.yml
- defaults/proxy.yml
- defaults/urls.yml
roles:
- cloudera_base_common
#install the CDH manager server files
- hosts: cdh-manager
vars_files:
- defaults/proxy.yml
- defaults/cdh.yml
- defaults/env.yml
roles:
- cloudera_base_manager
#install CDH agents on all hosts
- hosts: cdh-all-nodes
vars_files:
- defaults/proxy.yml
- defaults/env.yml
roles:
- cloudera_base_node
#install KRB5 common files
- hosts: cdh-all
vars_files:
- defaults/proxy.yml
- defaults/cdh.yml
roles:
- { role: kerberos_base_common, when: kerberos_enabled|bool }
#install KRB5 server
- hosts: cdh-manager
vars_files:
- defaults/arcadia.yml
- defaults/proxy.yml
- defaults/cdh.yml
- defaults/urls.yml
roles:
- { role: kerberos_base_server, when: kerberos_enabled|bool }
#install and configure the cloudera cluster
- hosts: cdh-manager
vars_files:
- defaults/cdh.yml
- defaults/proxy.yml
- defaults/env.yml
- defaults/cloudera_parcels.yml
- defaults/hgm.yml
roles:
- { role: cloudera_api_manager, tags: skip_on_vagrant }
#install ATK client on all hosts
- hosts: cdh-all-nodes
vars_files:
- defaults/proxy.yml
roles:
- cloudera_atk_client
- hosts: cdh-all
vars_files:
- defaults/cdh.yml
- defaults/proxy.yml
roles:
- cloudera_sqoop_metastore
- hosts: consul-server
vars_files:
- defaults/consul.yml
- defaults/proxy.yml
- defaults/env.yml
roles:
- { role: consul_base_agent, tags: skip_on_one_node_install }
- { role: consul_base_server, tags: skip_on_one_node_install }
- hosts: cdh-manager
vars_files:
- defaults/cdh.yml
- defaults/proxy.yml
- defaults/env.yml
roles:
- { role: cloudera_backups, when: configure_backup, tags: skip_on_vagrant }
- hosts: cdh-master-[0]
vars_files:
- defaults/cdh.yml
- defaults/proxy.yml
- defaults/env.yml
roles:
- { role: cloudera_backups_hdfs, when: configure_backup, tags: skip_on_vagrant }
- hosts: cdh-manager
vars_files:
- defaults/cdh.yml
- defaults/proxy.yml
roles:
- cloudera_atk_config_tool
- hosts: zabbix-server
vars_files:
- defaults/zabbix.yml
roles:
- { role: zabbix_base_server, tags: skip_on_one_node_install }
- hosts: zabbix-web
vars_files:
- defaults/zabbix.yml
roles:
- { role: zabbix_base_web, tags: skip_on_one_node_install }
- hosts: cdh-master[-1]
vars_files:
- defaults/zabbix.yml
roles:
- { role: zabbix_base_proxy, tags: skip_on_one_node_install }
- include: db-lb.yml
- include: mysql-cluster.yml