-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhot_mesos_ifca_cms.org.yaml
327 lines (308 loc) · 8.97 KB
/
hot_mesos_ifca_cms.org.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
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
heat_template_version: 2013-05-23
description: >
TOSCA example for specifying a Mesos Cluster
parameters:
cms_stageoutsite_fallback:
type: string
default: DUMMY
iam_token:
type: string
default: my_token
cms_local_site:
type: string
default: T2_ES_IFCA
cms_stageoutprefix_fallback:
type: string
default: DUMMY
imageCMS:
type: string
description: Image used to boot a server
default: ubuntu16-software-config-ifca
cms_stageoutserver:
type: string
default: srmfe01.ifca.es
cms_stageoutserver_fallback:
type: string
default: DUMMY
cms_input_path:
type: string
default: DUMMY
elasticsearch_secret:
type: string
default: 5z0O87gnSf
onedatacache:
type: string
default: 160.44.194.19
onedatatoken:
type: string
default: DUMMYTOKEN
cms_stageoutsite:
type: string
default: T2_ES_IFCA
cms_input_protocol:
type: string
default: xrootd
monitordb_ip:
type: string
default: 193.205.222.247:8080
iam_client_secret:
type: string
default: myclient_secret
iam_client_id:
type: string
default: myclient_id
cms_stageoutprefix:
type: string
default: srm://srmfe02.ifca.es:8444/srm/managerv2?SFN=/cmsdisk/
networkCMS:
type: string
description: Network ID for the servers
default: 2b729f05-cda2-4316-bab6-4247aa06d708
subnetCMS:
type: string
description: Sub Network ID for the servers
default: daac11bd-9f18-4256-a22d-faa2939b221e
key_name:
type: string
description: Name of keypair to assign to servers
default: heat-proxy
flavor_master:
type: string
description: flavor to use when booting the master
default: cm4.xlarge
flavor_slave:
type: string
description: flavor to use when booting the slave
default: cm4.large
flavor_lb:
type: string
description: flavor to use when booting the load balancer
default: cm4.large
resources:
###########################################################
#
# Security groups
#
###########################################################
server_security_group:
type: OS::Neutron::SecurityGroup
properties:
description: Security Group to allow traffic into the server.
name: security-group-ssh
rules: [
{remote_ip_prefix: 0.0.0.0/0,
protocol: tcp,
port_range_min: 22,
port_range_max: 22},
{remote_ip_prefix: 0.0.0.0/0,
protocol: icmp}]
mesos_security_group:
type: OS::Neutron::SecurityGroup
properties:
description: Security group for mesos access
name: security-group-mesos
rules:
- protocol: tcp
port_range_min: 5050
port_range_max: 5050
- protocol: tcp
port_range_min: 8443
port_range_max: 8443
- protocol: tcp
port_range_min: 4443
port_range_max: 4443
- protocol: tcp
port_range_min: 8080
port_range_max: 8080
secgroup_all_open:
type: OS::Neutron::SecurityGroup
properties:
rules:
- protocol: icmp
- protocol: tcp
- protocol: udp
vip_port:
type: OS::Neutron::Port
properties:
network: {get_param: networkCMS}
security_groups:
- get_resource: secgroup_all_open
replacement_policy: AUTO
##########################################################
#
# Ansible setup
#
##########################################################
ansible_setup_config:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: role_list
type: CommaDelimitedList
config: { get_file: 'templates_mesos/setup_ansible.sh' }
##########################################################
#
# Mesos Config
#
##########################################################
mesos-master_config:
type: OS::Heat::SoftwareConfig
properties:
group: ansible
inputs:
# - name: mesos_masters_list
# type: CommaDelimitedList
- name: consul_servers_list
- name: zookeeper_host_list
- name: zookeeper_peers
- name: marathon_username
- name: marathon_password
- name: enable_chronos
config: |
---
- hosts: localhost
vars:
docker_bridge_ip: "172.0.17.1"
connection: local
pre_tasks:
- name: Fix /etc/hosts
lineinfile: dest=/etc/hosts regexp='^127\.0\.1\.1' line="{{ ansible_default_ipv4.address }}\t{{ansible_fqdn}} {{ ansible_hostname }}"
- name: Update /etc/hosts
lineinfile: dest=/etc/hosts line="{{ ansible_default_ipv4.address }}\t{{ansible_fqdn}} {{ ansible_hostname }}"
roles:
- { role: indigo-dc.consul, consul_mode: "server" }
- { role: indigo-dc.zookeeper }
- { role: indigo-dc.mesos, mesos_install_moe: "master" }
- { role: indigo-dc.marathon }
mesos-slave_config:
type: OS::Heat::SoftwareConfig
properties:
group: ansible
inputs:
##########################################################
#
# Mesos Master Deployment
#
##########################################################
# Mesos Master
mesos-master-server:
type: OS::Nova::Server
properties:
name: mesos-master-server
flavor: { get_param: flavor_master }
user_data_format: SOFTWARE_CONFIG
image: { get_param: imageCMS }
key_name: { get_param: key_name }
networks:
- port: { get_resource: server_port }
server_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: networkCMS }
fixed_ips:
- subnet_id: { get_param: subnetCMS }
security_groups:
- { get_resource: server_security_group }
- { get_resource: mesos_security_group }
# Install new ansible version and roles
mesos-master_deployment_ansible:
type: OS::Heat::SoftwareDeployment
properties:
input_values:
role_list: "consul,zookeeper,mesos,marathon,cms_config"
config:
get_resource: ansible_setup_config
server:
get_resource: mesos-master-server
mesos-master_deployment:
type: OS::Heat::SoftwareDeployment
properties:
input_values:
enable_chronos: false
marathon_username: test_user
marathon_pass: test_pass
mesos_password: admin
mesos_username: admin
mesos_masters_list:
get_attr:
- mesos-master-server
- networks
- private
- 0
consul_servers: "{{mesos_masters_list}}"
zookeeper_host_list: "{{mesos_masters_list}}"
zookeeper_peers: "{{mesos_masters_list}}"
config:
get_resource: mesos-master_config
server:
get_resource: mesos-master-server
depends_on:
- mesos-master_deployment_ansible
##########################################################
#
# CMS Services Config in Master
#
##########################################################
# Config
cms_services_config:
type: OS::Heat::SoftwareConfig
properties:
group: ansible
inputs:
- name: cms_config_mysquid_host
- name: cms_config_proxycache_host
- name: cms_config_iamtoken
- name: cms_config_iam_client_id
- name: cms_config_iam_client_secret
- name: cms_config_cms_local_site
- name: cms_config_squid_image
- name: cms_config_wn_image
- name: cms_config_proxycache_image
- name: cms_config_onedatacache
- name: cms_config_onedatatoken
- name: marathon_username
- name: marathon_password
config: |
---
- hosts: localhost
vars:
connection: local
roles:
- { role: indigo-dc.cms_config }
#Deployment
cms_services_deployment:
type: OS::Heat::SoftwareDeployment
properties:
input_values:
cms_config_mysquid_host:
get_attr:
- vip_port
- fixed_ips
- 0
- ip_address
cms_config_proxycache_host: "{{ cms_config_mysquid_host}}"
cms_config_squid_image: spiga/frontiersquidv1
cms_config_cms_local_site:
get_param: cms_local_site
cms_config_iam_client_id:
get_param: iam_client_id
cms_config_iam_client_secret:
get_param: iam_client_secret
cms_config_iamtoken:
get_param: iam_token
marathon_user: admin
marathon_pass: test_pass
cms_config_wn_image: spiga/cmswn
cms_config_onedatacache:
get_param: onedatacache
cms_config_onedatatoken:
get_param: onedatatoken
cms_config_proxycache_image: spiga/ttscache
config:
get_resource: cms_services_config
server:
get_resource: mesos-master-server
depends_on:
- mesos-master_deployment
outputs: