-
Notifications
You must be signed in to change notification settings - Fork 1
/
lamp.yaml
179 lines (155 loc) · 4.51 KB
/
lamp.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
heat_template_version: 2013-05-23
description: |
This is a Heat template to deploy a server with LAMP
parameter_groups:
- label: Server Settings
parameters:
- server_hostname
- image
- flavor
- label: phpMyAdmin Settings
parameters:
- phpmyadmin_user
- label: rax-dev-params
parameters:
- kitchen
- chef_version
parameters:
server_hostname:
label: Server Name
description: Hostname to use for setting the server name.
type: string
default: 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:
label: Operating System
description: |
Required: Server image used for all servers that are created as a part of
this deployment.
type: string
default: CentOS 6.5 (PVHVM)
constraints:
- allowed_values:
- CentOS 6.5 (PVHVM)
- Red Hat Enterprise Linux 6.5 (PVHVM)
- Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
- Ubuntu 12.04 LTS (Precise Pangolin)
- Debian 7 (Wheezy) (PVHVM)
description: Must be a supported operating system.
flavor:
label: Server Size
description: |
Required: Rackspace Cloud Server flavor to use. The size is based on the
amount of RAM for the provisioned server.
type: string
default: 1 GB Performance
constraints:
- allowed_values:
- 1 GB Performance
- 2 GB Performance
- 4 GB Performance
- 8 GB Performance
- 15 GB Performance
- 30 GB Performance
description: |
Must be a valid Rackspace Cloud Server flavor for the region you have
selected to deploy into.
phpmyadmin_user:
label: Username
description: "Username for phpMyAdmin logins."
type: string
default: serverinfo
constraints:
- allowed_pattern: "^(.){1,16}$"
description: |
Must be shorter than 16 characters, this is due to MySQL's maximum
username length.
kitchen:
description: URL for the kitchen to use
type: string
default: https://github.com/rillip3/ChefAnsibleWrapper/
chef_version:
description: Version of chef client to use
type: string
default: 11.12.8
resources:
ssh_key:
type: "OS::Nova::KeyPair"
properties:
name: { get_param: "OS::stack_id" }
save_private_key: true
mysql_root_password:
type: "OS::Heat::RandomString"
properties:
length: 16
sequence: lettersdigits
mysql_repl_password:
type: "OS::Heat::RandomString"
properties:
length: 16
sequence: lettersdigits
mysql_debian_password:
type: "OS::Heat::RandomString"
properties:
length: 16
sequence: lettersdigits
phpmyadmin_pass:
type: "OS::Heat::RandomString"
properties:
length: 16
sequence: lettersdigits
linux_server:
type: "Rackspace::Cloud::Server"
properties:
name: { get_param: server_hostname }
flavor: { get_param: flavor }
image: { get_param: image }
key_name: { get_resource: ssh_key }
config_drive: "true"
linux_setup:
type: "OS::Heat::ChefSolo"
depends_on: linux_server
properties:
username: root
private_key: { get_attr: [ssh_key, private_key] }
host: { get_attr: [linux_server, accessIPv4] }
kitchen: { get_param: kitchen }
chef_version: { get_param: chef_version }
node:
mysql:
server_root_password: { get_attr: [mysql_root_password, value] }
server_repl_password: { get_attr: [mysql_repl_password, value] }
server_debian_password: { get_attr: [mysql_debian_password, value] }
phpmyadmin:
pass: { get_attr: [phpmyadmin_pass, value] }
user: { get_param: phpmyadmin_user }
run_list: ["recipe[LAMP]"]
outputs:
private_key:
description: SSH Private Key
value: { get_attr: [ssh_key, private_key] }
server_ip:
description: Server IP
value: { get_attr: [linux_server, accessIPv4] }
phpmyadmin_url:
description: phpMyAdmin URL
value:
str_replace:
template: "http://%server_ip%/phpmyadmin"
params:
"%server_ip%": { get_attr: [linux_server, accessIPv4] }
phpmyadmin_user:
description: phpMyAdmin User
value: { get_param: phpmyadmin_user }
phpmyadmin_password:
description: phpMyAdmin Password
value: { get_attr: [phpmyadmin_pass, value] }
mysql_root_password:
description: MySQL Root Password
value: { get_attr: [mysql_root_password, value] }