-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdjango-single.yaml
222 lines (195 loc) · 5.84 KB
/
django-single.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
heat_template_version: 2013-05-23
description: |
Heat template to deploy a single Django server
parameters:
database_host:
description: Cloud Database hostname.
type: string
server_hostname:
description: Server Name
type: string
default: django
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.
server_count:
description: Number of servers to deploy
type: number
default: 1
constraints:
- range:
min: 0
max: 24
description: Must be between 0 and 24 servers.
image:
description: Server Image
type: string
default: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) (Orchestration)
constraints:
- allowed_values:
- Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) (Orchestration)
- Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
description: Must be a supported operating system.
flavor:
description: Rackspace Cloud Server flavor
type: string
default: 4 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
- 60 GB I/O v1
- 90 GB Performance
- 512MB Standard Instance
- 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.
db_user:
description: "Username for the database."
type: string
default: db_user
constraints:
- allowed_pattern: "^(.){1,16}$"
description: |
Must be shorter than 16 characters, this is due to MySQL's maximum
username length.
db_pass:
type: string
hidden: true
description: Database access password
default: secret123
ssh_keypair_name:
description: Nova keypair name for ssh access to the server
type: string
virtualenv:
label: virtualenv
type: string
default: venv
description: |
Python Virtual Environment in which Django will be installed.
It will be created in the /srv directory.
project_name:
type: string
description: The name to use to create your Django project.
default: mysite
constraints:
- allowed_pattern: "^[A-Za-z0-9_]{1,31}$"
description: |
Must be alphanumeric and fewer than 32 chanracters.
app_name:
type: string
description: The name of your app.
default: myapp
constraints:
- allowed_pattern: "^[A-Za-z0-9_]{1,31}$"
description: |
Must be alphanumeric and fewer than 32 chanracters.
django_admin_user:
type: string
description: Username for login to Django
default: djangouser
constraints:
- allowed_pattern: "^(?=.*).{0,256}$"
description: |
Must be less than 256 chanracters.
django_admin_email:
type: string
description: Email address
default: admin@example.com
constraints:
- allowed_pattern: "^(?=.*).{0,512}$"
description: |
Must be less than 512 chanracters.
django_admin_pass:
type: string
hidden: true
description: Django admin password
default: secret123
venv_username:
label: System User
type: string
default: pydev
description: |
Username with which to login to the Linux servers. This user
will be the owner of the Python Virtual Environment under which Django
is installed.
constraints:
- allowed_pattern: "^(?!^root$)([a-z_][a-z0-9_]{0,30})$"
description: alphanumeric, lowercase, and not root.
private_key:
description: Private SSH key
type: string
default: false
kitchen:
label: Kitchen
description: |
URL for the kitchen to use, fetched using git
type: string
default: https://github.com/rackspace-orchestration-templates/django-clouddb
chef_version:
label: Chef Version
description: Version of chef client to use
type: string
default: 11.14.6
parent_stack_id:
label: Parent Stack ID
type: string
default: none
resources:
django_server:
type: "OS::Nova::Server"
properties:
name: { get_param: server_hostname }
flavor: { get_param: flavor }
image: { get_param: image }
key_name: { get_param: ssh_keypair_name }
metadata:
rax-heat: { get_param: parent_stack_id }
django_setup:
type: "OS::Heat::ChefSolo"
depends_on: django_server
properties:
username: root
private_key: { get_param: private_key }
host: { get_attr: [django_server, accessIPv4] }
kitchen: { get_param: kitchen }
chef_version: { get_param: chef_version }
node:
django:
username: { get_param: venv_username }
virtualenv: { get_param: virtualenv }
project_name: { get_param: project_name }
app_name: { get_param: app_name }
database_name: app_data
database_user: { get_param: db_user }
database_password: { get_param: db_pass }
database_host: { get_param: database_host }
django_admin_user: { get_param: django_admin_user }
django_admin_email: { get_param: django_admin_email }
django_admin_pass: { get_param: django_admin_pass }
rax:
firewall:
tcp: [80]
run_list: ["recipe[apt]",
"recipe[build-essential]",
"recipe[python-django]",
"recipe[rax-firewall]"]
outputs:
privateIPv4:
value: { get_attr: [django_server, networks, private, 0] }
accessIPv4:
value: { get_attr: [django_server, accessIPv4] }