/
wordpress-web-server.yaml
309 lines (271 loc) · 8.33 KB
/
wordpress-web-server.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
heat_template_version: 2013-05-23
description: |
This is a Heat template to deploy a single Linux server running a WordPress.
parameters:
# Server settings
agent_config:
type: string
description: User data for installing and configuring monitoring agent
default: ""
wp_web_server_hostname:
description: WordPress Web Server Name
type: string
default: WordPress-Web
constraints:
- length:
min: 1
max: 64
- allowed_pattern: "^[a-zA-Z][a-zA-Z0-9-]*$"
description: |
Must begin with a letter and contain only alphanumeric characters.
image:
description: Server Image used for all servers.
type: string
default: Ubuntu 12.04 LTS (Precise Pangolin) (PVHVM)
constraints:
- allowed_values:
- Ubuntu 12.04 LTS (Precise Pangolin) (PVHVM)
description: Must be a supported operating system.
wp_web_server_flavor:
description: Web Cloud Server flavor
type: string
default: 2 GB General Purpose v1
constraints:
- allowed_values:
- 1 GB General Purpose v1
- 2 GB General Purpose v1
- 4 GB General Purpose v1
- 8 GB General Purpose v1
- 15 GB I/O v1
- 30 GB I/O v1
- 1GB Standard Instance
- 2GB Standard Instance
- 4GB Standard Instance
- 8GB Standard Instance
- 15GB Standard Instance
- 30GB Standard Instance
description: |
Must be a valid Rackspace Cloud Server flavor for the region you have
selected to deploy into.
# WordPress settings
domain:
description: Domain to be used with WordPress site
type: string
default: "example.com"
version:
description: Version of WordPress to install
type: string
default: 4.2.2
# Optional Apache settings (SSL certs)
# ssl_private_key:
# description: Private SSL key
# type: string
# default: ""
# constraints:
# - allowed_pattern: "^(.){0,5000}$"
# description: "Key values must be under 5,000 characters"
# ssl_certificate:
# description: Public SSL key
# type: string
# default: ""
# constraints:
# - allowed_pattern: "^(.){0,5000}$"
# description: "Certificate values must be under 5,000 characters"
# ssl_intermediate_certs:
# description: Intermediate SSL Certificates
# type: string
# default: ""
# constraints:
# - allowed_pattern: "^(.){0,5000}$"
# description: "Intermediate values must be under 5,000 characters."
# Database and system user configuration
prefix:
description: Prefix to use for
type: string
default: wp_
database_name:
description: WordPress database name
type: string
default: wordpress
database_host:
description: IP/Host of the database server
type: string
default: 127.0.0.1
memcached_host:
description: IP/Host of the memcached server
type: string
default: 127.0.0.1
username:
description: "Username for system, database, and WordPress logins."
type: string
default: wp_user
database_password:
description: "Password to use for database connections."
type: string
# SSH Keypair naming
ssh_keypair_name:
description: "keypair name to register with Nova for the root SSH key"
type: string
ssh_public_key:
type: string
ssh_private_key:
type: string
# Lsync public key
lsync_pub:
description: Public key for lsync configuration
type: string
constraints:
# Varnish Master backend
varnish_master_backend:
description: Master backend host for admin calls in Varnish
type: string
default: "localhost"
# Random strings for WP salting
wp_auth:
type: string
wp_logged_in:
type: string
wp_nonce:
type: string
wp_secure_auth:
type: string
# Chef configuration options
kitchen:
description: URL for the kitchen to use
type: string
default: https://github.com/rackspace-orchestration-templates/wordpress-multi
chef_version:
description: Version of chef client to use
type: string
default: 11.16.2
# parent stack id for metadata
parent_stack_id:
description: Stack id of the parent stack
type: string
default: "none"
resources:
wp_web_server:
type: "OS::Nova::Server"
properties:
name: { get_param: wp_web_server_hostname }
flavor: { get_param: wp_web_server_flavor }
image: { get_param: image }
key_name: { get_param: ssh_keypair_name }
config_drive: true
user_data_format: RAW
user_data: { get_param: agent_config }
metadata:
rax-heat: { get_param: parent_stack_id }
node_cpu_check:
type: Rackspace::CloudMonitoring::Check
properties:
entity: { get_resource: wp_web_server }
type: agent.cpu
label: node_cpu_check
details: {}
metadata:
rax-heat: { get_param: "OS::stack_id" }
stack-name: { get_param: "OS::stack_name" }
period: 30
timeout: 10
node_mem_check:
type: Rackspace::CloudMonitoring::Check
properties:
entity: { get_resource: wp_web_server }
type: agent.memory
label: node_mem_check
details: {}
metadata:
rax-heat: { get_param: "OS::stack_id" }
stack-name: { get_param: "OS::stack_name" }
period: 30
timeout: 10
node_filesystem_check:
type: Rackspace::CloudMonitoring::Check
properties:
entity: { get_resource: wp_web_server }
type: agent.filesystem
label: node_fs_check
details:
target: "/"
metadata:
rax-heat: { get_param: "OS::stack_id" }
stack-name: { get_param: "OS::stack_name" }
period: 30
timeout: 10
wp_web_server_setup:
type: "OS::Heat::ChefSolo"
depends_on: wp_web_server
properties:
username: root
private_key: { get_param: ssh_private_key }
host: { get_attr: [wp_web_server, accessIPv4] }
kitchen: { get_param: kitchen }
chef_version: { get_param: chef_version }
node:
apache:
listen_ports: [8080]
timeout: 30
serversignature: "Off"
traceenable: "Off"
varnish:
version: "3.0"
listen_port: "80"
wordpress:
version: { get_param: version }
server_aliases: [{ get_param: domain }]
dir:
str_replace:
template: "/var/www/vhosts/%domain%"
params:
"%domain%": { get_param: domain }
db:
name: { get_param: database_name }
user: { get_param: username }
pass: { get_param: database_password }
host: { get_param: database_host }
keys:
auth: { get_param: wp_auth }
logged_in: { get_param: wp_logged_in }
nonce_key: { get_param: wp_nonce }
secure_auth_key: { get_param: wp_secure_auth }
rax:
apache:
domain: { get_param: domain }
# ssl_private_key: { get_param: ssl_private_key }
# ssl_certificate: { get_param: ssl_certificate }
# ssl_intermediate_certs: { get_param: ssl_intermediate_certs }
lsyncd:
ssh:
pub: { get_param: lsync_pub }
memcache:
server: { get_param: memcached_host }
packages:
- php5-imagick
varnish:
master_backend: { get_param: varnish_master_backend }
wordpress:
admin_pass: { get_param: database_password }
user:
name: { get_param: username }
group: { get_param: username }
run_list: ["recipe[apt]",
"recipe[build-essential]",
"recipe[rax-wordpress::apache-prep]",
"recipe[rax-wordpress::x509]",
"recipe[php]",
"recipe[rax-install-packages]",
"recipe[wordpress]",
"recipe[rax-wordpress::user]",
"recipe[rax-wordpress::memcache]",
"recipe[varnish::repo]",
"recipe[varnish]",
"recipe[rax-wordpress::apache]",
"recipe[rax-wordpress::varnish]",
"recipe[rax-wordpress::firewall]",
"recipe[rax-wordpress::lsyncd-client]"]
outputs:
accessIPv4:
value: { get_attr: [wp_web_server, accessIPv4] }
privateIPv4:
value: { get_attr: [wp_web_server, networks, private, 0] }