-
Notifications
You must be signed in to change notification settings - Fork 138
/
devstack-heat-template.yaml
218 lines (189 loc) · 6.11 KB
/
devstack-heat-template.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
# See docs/devstack/ for documentation on how to use this.
heat_template_version: 2016-10-14
description: Single-node devstack
parameters:
key_name:
type: string
label: SSH public key name
description: Name of the SSH public key to be used for access to the compute instance
floating_network_name:
type: string
label: Floating network name
default: floating
flavor_name:
type: string
label: Flavor
description: Flavor of the server
default: m1.large
image_name:
type: string
label: Image
description: Image to boot the server with
default: openSUSE-Leap-15.0
# This would be better, but DNS is broken:
# default: openSUSE-Leap-15.0-JeOS.x86_64
run_tempest:
type: boolean
label: Run Tempest
description: Set to 'True' to run Tempest tests. Defaults to 'False'.
default: False
automation_fork:
type: string
label: qa_devstack.sh fork
description: >-
GitHub user/organization from which to fetch the automation repo
which contains qa_devstack.sh.
default: SUSE-Cloud
automation_branch:
type: string
label: qa_devstack.sh branch
description: >-
GitHub branch from which to fetch the automation repo
which contains qa_devstack.sh.
default: master
devstack_fork:
type: string
label: devstack fork
description: GitHub user/organization from which to fetch devstack
default: openstack-dev
devstack_branch:
type: string
label: devstack branch
description: GitHub branch from which to fetch devstack
default: master
devstack_extra_config:
type: string
label: devstack extra config
description: >-
Extra configuration to put in local.conf. Config starts off
under the [[local|localrc]] header, but other headers can be
specified for text following them.
default:
conditions:
skip_tempest_res:
equals:
- {get_param: run_tempest}
- False
resources:
ping_ssh_secgroup:
type: OS::Neutron::SecurityGroup
properties:
name: ping_ssh_secgroup
description: Ping and SSH
rules:
- protocol: icmp
- protocol: tcp
port_range_min: 22
port_range_max: 22
network:
type: OS::Neutron::Net
properties:
port_security_enabled: True
subnet:
type: OS::Neutron::Subnet
properties:
network_id: { get_resource: network }
cidr: 10.1.1.0/24
ip_version: 4
enable_dhcp: True
allocation_pools:
- start: 10.1.1.50
end: 10.1.1.99
gateway_ip: 10.1.1.1
router_ext:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: { get_param: floating_network_name }
router_ext_interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router_ext }
subnet_id: { get_resource: subnet }
port:
type: OS::Neutron::Port
properties:
network: { get_resource: network }
fixed_ips:
- subnet_id: { get_resource: subnet }
security_groups:
- default
- { get_resource: ping_ssh_secgroup }
floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: floating
floating_ip_assoc:
type: OS::Neutron::FloatingIPAssociation
properties:
floatingip_id: { get_resource: floating_ip }
port_id: { get_resource: port }
server:
type: OS::Nova::Server
properties:
key_name: { get_param: key_name }
image: { get_param: image_name }
flavor: { get_param: flavor_name }
networks:
- port: { get_resource: port }
user_data_format: SOFTWARE_CONFIG
user_data:
get_resource: cloud_init
cloud_init:
type: OS::Heat::CloudConfig
properties:
cloud_config:
disable_root: false
groups:
- stack
users:
- name: stack
lock_passwd: False
sudo: ["ALL=(ALL) NOPASSWD:ALL\nDefaults:stack !requiretty"]
shell: /bin/bash
primary_group: stack
# Not supported on openSUSE yet; causes this message:
# Skipping modules 'ssh-import-id' because they are not verified on distro 'opensuse'. To run anyway, add them to 'unverified_modules' in config.
#ssh_import_id: { get_param: key_name }
runcmd:
# Work around https://bugs.launchpad.net/cloud-init/+bug/1486113
- mkdir /home/stack/.ssh
- cp -p /root/.ssh/authorized_keys /home/stack/.ssh
# Use curl to retrieve qa_devstack.sh server-side rather than relying
# on heat's write_files client-side magic. This works around
# https://bugs.launchpad.net/cloud-init/+bug/1486113 which would write
# the file before the stack user/group exist, but more importantly, it
# allows us to dynamically determine the URL from the parameters.
- str_replace:
template: |
curl -o /home/stack/qa_devstack.sh \
https://raw.githubusercontent.com/$fork/automation/$branch/scripts/jenkins/qa_devstack.sh
params:
$fork:
get_param: automation_fork
$branch:
get_param: automation_branch
- chmod 755 /home/stack/qa_devstack.sh
- chown -R stack:stack /home/stack
- str_replace:
template: |
export HOME=/root
export DISABLE_TEMPESTRUN=$tempest
export DEVSTACK_FORK=$fork
export DEVSTACK_BRANCH=$branch
export DEVSTACK_EXTRA_CONFIG="$extra"
/home/stack/qa_devstack.sh # ipv6
params:
$fork:
get_param: devstack_fork
$branch:
get_param: devstack_branch
$tempest:
if: ["skip_tempest_res", "yes", ""]
$extra:
get_param: devstack_extra_config
outputs:
# floating IP address of the admin node
floating-ip:
description: Floating IP address of the admin node
value: { get_attr: [floating_ip, floating_ip_address] }