-
Notifications
You must be signed in to change notification settings - Fork 0
/
high_availability_chef_server-HOT.yml
273 lines (246 loc) · 9.05 KB
/
high_availability_chef_server-HOT.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
265
266
267
268
269
270
271
272
273
heat_template_version: 2013-05-23
description: >
This is an HA environment for Chef Server 12.
This will install everything that is required
for http://docs.chef.io/install_server_ha_drbd.html
parameters:
key_name:
type: string
label: key_name
description: Name of key-pair to be used for compute instance
default: admin
image_id:
type: string
label: image_id
description: Name of the image to use for compute instance
default: ubuntu-trusty
instance_type:
type: string
label: instance_type
description: Type of instance (flavor) to be used
default: m1.medium
constraints:
- allowed_values: [ m1.medium, m1.large, m1.xlarge ]
description: Value must be m1.medium, m1.large, or m1.xlarge
public_net:
type: string
description: public network id
secgroup_id:
type: string
description : Id of the security group
resources:
private_net:
type: OS::Neutron::Net
properties:
name: private-net
private_subnet:
type: OS::Neutron::Subnet
properties:
network_id: { get_resource: private_net }
cidr: 172.16.2.0/24
gateway_ip: 172.16.2.1
backend_net:
type: OS::Neutron::Net
properties:
name: backend
backend_subnet:
type: OS::Neutron::Subnet
properties:
network_id: { get_resource: backend_net }
cidr: 10.10.10.0/24
chefrouter:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: { get_param: public_net }
chefrouter_interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: chefrouter }
subnet_id: { get_resource: private_subnet }
chefserver-be1_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: private_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_resource: private_subnet }
chefserver-be1-private_port:
type: OS::Neutron::Port
properties:
admin_state_up: true
network_id: { get_resource: backend_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_resource: backend_subnet }
chefserver-be2_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: private_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_resource: private_subnet }
chefserver-be2-private_port:
type: OS::Neutron::Port
properties:
admin_state_up: true
network_id: { get_resource: backend_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_resource: backend_subnet }
chefserver-fe1_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: private_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_resource: private_subnet }
chefserver-fe1_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: { get_param: public_net }
port_id: { get_resource: chefserver-fe1_port }
chefserver-fe2_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: private_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_resource: private_subnet }
chefserver-fe2_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: { get_param: public_net }
port_id: { get_resource: chefserver-fe2_port }
chefserver-fe3_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: private_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_resource: private_subnet }
chefserver-fe3_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: { get_param: public_net }
port_id: { get_resource: chefserver-fe3_port }
chefserver-lb_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: private_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_resource: private_subnet }
chefserver-lb_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: { get_param: public_net }
port_id: { get_resource: chefserver-lb_port }
chefserver-be1:
type: OS::Nova::Server
properties:
name: chefserver-be1
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: m1.medium
admin_user: ubuntu
networks:
- port: { get_resource: chefserver-be1_port }
- port: { get_resource: chefserver-be1-private_port }
user_data: |
#!/bin/bash
sudo apt-get update
sudo echo "127.0.0.1 chefserver-be1 chefserver-be1" >> /etc/hosts
sudo apt-get install -y drbd8-utils wget
sudo wget -P /tmp/ https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.2-1_amd64.deb
sudo dpkg -i /tmp/chef-server-core_12.1.2-1_amd64.deb
chefserver-be2:
type: OS::Nova::Server
properties:
name: chefserver-be2
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: m1.medium
admin_user: ubuntu
networks:
- port: { get_resource: chefserver-be2_port }
- port: { get_resource: chefserver-be2-private_port }
user_data: |
#!/bin/bash
sudo apt-get update
sudo echo "127.0.0.1 chefserver-be2 chefserver-be2" >> /etc/hosts
sudo apt-get install -y drbd8-utils wget
sudo wget -P /tmp/ https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.2-1_amd64.deb
sudo dpkg -i /tmp/chef-server-core_12.1.2-1_amd64.deb
chefserver-fe1:
type: OS::Nova::Server
properties:
name: chefserver-fe1
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: m1.medium
admin_user: ubuntu
networks:
- port: { get_resource: chefserver-fe1_port }
user_data: |
#!/bin/bash
sudo apt-get update
sudo echo "127.0.0.1 chefserver-fe1 chefserver-fe1" >> /etc/hosts
sudo apt-get -y wget
sudo wget -P /tmp/ https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.2-1_amd64.deb
sudo dpkg -i /tmp/chef-server-core_12.1.2-1_amd64.deb
chefserver-fe2:
type: OS::Nova::Server
properties:
name: chefserver-fe2
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: m1.medium
admin_user: ubuntu
networks:
- port: { get_resource: chefserver-fe2_port }
user_data: |
#!/bin/bash
sudo apt-get update
sudo echo "127.0.0.1 chefserver-fe2 chefserver-fe2" >> /etc/hosts
sudo apt-get -y wget
sudo wget -P /tmp/ https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.2-1_amd64.deb
sudo dpkg -i /tmp/chef-server-core_12.1.2-1_amd64.deb
chefserver-fe3:
type: OS::Nova::Server
properties:
name: chefserver-fe3
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: m1.medium
admin_user: ubuntu
networks:
- port: { get_resource: chefserver-fe3_port }
user_data: |
#!/bin/bash
sudo apt-get update
sudo echo "127.0.0.1 chefserver-fe3 chefserver-fe3" >> /etc/hosts
sudo apt-get -y wget
sudo wget -P /tmp/ https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.2-1_amd64.deb
sudo dpkg -i /tmp/chef-server-core_12.1.2-1_amd64.deb
chefserver-lb:
type: OS::Nova::Server
properties:
name: chefserver-lb
key_name: { get_param: key_name }
image: { get_param: image_id }
admin_user: ubuntu
flavor: m1.medium
networks:
- port: { get_resource: chefserver-lb_port }
user_data: |
#!/bin/bash
sudo apt-get update
sudo echo "127.0.0.1 chefserver-lb chefserver-lb" >> /etc/hosts
outputs:
chefserver-be1_private_ip:
description: Private IP address of chefserver-be1
value: { get_attr: [ chefserver-be1, first_address ] }
chefserver-be2_private_ip:
description: Private IP address of chefserver-be2
value: { get_attr: [ chefserver-be2, first_address ] }