forked from redhat-openstack/openshift-on-openstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
infra.yaml
363 lines (303 loc) · 8.3 KB
/
infra.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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
heat_template_version: 2014-10-16
description: >
A host used for running openshift-ansible playbooks and other optional services.
parameters:
key_name:
type: string
constraints:
- custom_constraint: nova.keypair
image:
type: string
constraints:
- custom_constraint: glance.image
flavor:
type: string
constraints:
- custom_constraint: nova.flavor
hostname:
type: string
domain_name:
type: string
rhn_username:
type: string
rhn_password:
type: string
hidden: true
rhn_pool:
type: string
hidden: true
ssh_user:
type: string
external_network:
type: string
constraints:
- custom_constraint: neutron.network
fixed_network:
type: string
constraints:
- custom_constraint: neutron.network
fixed_subnet:
type: string
constraints:
- custom_constraint: neutron.subnet
ansible_public_key:
type: string
ansible_private_key:
type: string
deployment_type:
type: string
lb_hostname:
type: string
default: ''
ldap_url:
type: string
default: ''
ldap_preferred_username:
type: string
default: 'uid'
ldap_bind_dn:
type: string
default: ''
ldap_bind_password:
type: string
default: ''
ldap_ca:
type: string
default: ''
ldap_insecure:
type: string
default: false
openshift_sdn:
type: string
dns_ip:
type: string
description: IP address of the DNS server
docker_volume_size:
type: number
description: >
size of a cinder volume in GB to allocate to docker for container/image
storage
default: 25
floating_ip:
type: string
port:
description: Neutron port (with a floating IP address) to assign to the DNS Nova Server
type: string
lb_ip:
type: string
default: ''
ldap_ip:
type: string
default: ''
ldap_hostname:
type: string
default: ''
deploy_registry:
type: boolean
deploy_router:
type: boolean
timeout:
description: Time to wait until the master setup is ready.
type: number
default: 4000
skip_ansible:
type: boolean
openshift_ansible_git_url:
type: string
openshift_ansible_git_rev:
type: string
resources:
host:
type: OS::Nova::Server
properties:
name:
str_replace:
template: "HOST.DOMAIN"
params:
HOST: {get_param: hostname}
DOMAIN: {get_param: domain_name}
admin_user: {get_param: ssh_user}
image: {get_param: image}
flavor: {get_param: flavor}
key_name: {get_param: key_name}
networks:
- port: {get_param: port}
user_data_format: SOFTWARE_CONFIG
user_data: {get_resource: init}
config_agent:
type: collect-config-setup/install_config_agent_centos_yum.yaml
run_ansible:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: node_hostname
- name: all_master_nodes
outputs:
- name: ca_cert
- name: ca_key
config:
str_replace:
params:
$ALL_MASTER_NODES: $all_master_nodes
$DOMAINNAME: {get_param: domain_name}
$NODE_HOSTNAME: $node_hostname
$SSH_USER: {get_param: ssh_user}
$DEPLOYMENT_TYPE: {get_param: deployment_type}
$LB_HOSTNAME: {get_param: lb_hostname}
$LDAP_URL: {get_param: ldap_url}
$LDAP_PREFERRED_USERNAME: {get_param: ldap_preferred_username}
$LDAP_BIND_DN: {get_param: ldap_bind_dn}
$LDAP_BIND_PASSWORD: {get_param: ldap_bind_password}
$LDAP_CA: {get_param: ldap_ca}
$LDAP_INSECURE: {get_param: ldap_insecure}
$OPENSHIFT_SDN: {get_param: openshift_sdn}
$DEPLOY_REGISTRY: {get_param: deploy_registry}
$DEPLOY_ROUTER: {get_param: deploy_router}
$SKIP_ANSIBLE: {get_param: skip_ansible}
template: {get_file: fragments/master-ansible.sh}
init:
type: OS::Heat::MultipartMime
properties:
parts:
- config: {get_resource: set_hostname}
- config: {get_resource: included_files}
- config: {get_resource: rhn_register}
- config: {get_resource: host_update}
- config: {get_resource: set_dns}
- config: {get_attr: [config_agent, config]}
type: multipart
- config: {get_resource: infra_boot}
infra_boot:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
str_replace:
params:
$DNS_IP: {get_param: dns_ip}
$OPENSHIFT_ANSIBLE_GIT_URL: {get_param: openshift_ansible_git_url}
$OPENSHIFT_ANSIBLE_GIT_REV: {get_param: openshift_ansible_git_rev}
$WC_NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
template: {get_file: fragments/infra-boot.sh}
set_hostname:
type: OS::Heat::CloudConfig
properties:
cloud_config:
hostname: {get_param: hostname}
fqdn:
str_replace:
template: "HOST.DOMAIN"
params:
HOST: {get_param: hostname}
DOMAIN: {get_param: domain_name}
included_files:
type: OS::Heat::CloudConfig
properties:
cloud_config:
write_files:
- path: /usr/local/bin/retry
permissions: 0755
content: {get_file: fragments/retry.sh}
- path: /etc/hosts
content:
str_replace:
params:
$NODE_IP: {get_param: floating_ip}
$NODE_HOSTNAME: {get_param: hostname}
$NODE_DOMAIN: {get_param: domain_name}
template:
{get_file: fragments/etc-hosts}
#- path: /root/dnsmasq.conf
# content:
# str_replace:
# params:
# $DOMAINNAME: {get_param: domain_name}
# template: {get_file: fragments/dnsmasq.conf}
- path: /root/.ssh/id_rsa
permissions: 0600
content: {get_param: ansible_private_key}
- path: /root/.ssh/id_rsa.pub
permissions: 0600
content: {get_param: ansible_public_key}
ssh_authorized_keys:
- {get_param: ansible_public_key}
rhn_register:
type: OS::Heat::SoftwareConfig
properties:
config:
str_replace:
params:
$RHN_USERNAME: {get_param: rhn_username}
$RHN_PASSWORD: {get_param: rhn_password}
$POOL_ID: {get_param: rhn_pool}
template: {get_file: fragments/rhn-register.sh}
host_update:
type: OS::Heat::SoftwareConfig
properties:
config:
get_file: fragments/host-update.sh
set_dns:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
str_replace:
params:
$LB_DOMAIN: {get_param: domain_name}
$LB_HOSTNAME: {get_param: lb_hostname}
$LB_IP: {get_param: lb_ip}
$LDAP_HOSTNAME: {get_param: ldap_hostname}
$LDAP_IP: {get_param: ldap_ip}
$DOMAINNAME: {get_param: domain_name}
template: {get_file: fragments/infra-dns.sh}
tune_ansible:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
get_file: fragments/tune-ansible.sh
deployment_tune_ansible:
type: OS::Heat::SoftwareDeployment
properties:
actions: ['CREATE']
config:
get_resource: tune_ansible
server:
get_resource: host
node_add:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: node_etc_host
outputs:
- name: result
config:
get_file: fragments/infra-node-add.sh
node_cleanup:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: node_name
outputs:
- name: result
config:
get_file: fragments/infra-node-cleanup.sh
docker_volume:
type: OS::Cinder::Volume
properties:
size: {get_param: docker_volume_size}
docker_volume_attach:
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: {get_resource: host}
volume_id: {get_resource: docker_volume}
wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: {get_resource: wait_handle}
timeout: {get_param: timeout}
wait_handle:
type: OS::Heat::WaitConditionHandle