Merge ~hopem/stsstack-bundles:reorganise-module-defaults into stsstack-bundles:master

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: acf742a2c6f8770f8e14d74e3f6673f87baab341
Proposed branch: ~hopem/stsstack-bundles:reorganise-module-defaults
Merge into: stsstack-bundles:master
Diff against target: 887 lines (+215/-138)
48 files modified
.module_defaults/ceph (+1/-0)
.module_defaults/kubernetes (+1/-0)
.module_defaults/landscape (+1/-0)
.module_defaults/openstack (+1/-0)
.module_defaults/swift (+1/-0)
ceph/module_defaults (+16/-0)
ceph/pipeline/01import-config-defaults (+6/-0)
ceph/pipeline/02configure (+7/-15)
common/generate-bundle.sh (+6/-1)
dev/null (+0/-6)
kubernetes/module_defaults (+23/-0)
kubernetes/pipeline/01import-config-defaults (+6/-0)
kubernetes/pipeline/02configure (+5/-21)
landscape/module_defaults (+8/-0)
landscape/pipeline/01import-config-defaults (+4/-0)
landscape/pipeline/02configure (+6/-3)
lint/check_var_defaults.sh (+14/-0)
openstack/module_defaults (+49/-0)
openstack/openstack.yaml.template (+8/-8)
openstack/pipeline/01import-config-defaults (+7/-0)
openstack/pipeline/02configure (+6/-40)
overlays/ceph-rgw-ha.yaml (+0/-2)
overlays/ceph-rgw.yaml (+1/-1)
overlays/cinder-ha.yaml (+0/-1)
overlays/designate-ha.yaml (+0/-1)
overlays/designate.yaml (+1/-1)
overlays/glance-ha.yaml (+0/-1)
overlays/gnocchi.yaml (+1/-1)
overlays/heat-ha.yaml (+0/-1)
overlays/heat.yaml (+1/-1)
overlays/keystone-ha.yaml (+0/-1)
overlays/mysql-ha.yaml (+0/-2)
overlays/mysql.yaml (+2/-1)
overlays/neutron-api-ha.yaml (+0/-1)
overlays/nova-cloud-controller-ha.yaml (+0/-1)
overlays/octavia-dashboard.yaml (+1/-0)
overlays/octavia-ha.yaml (+0/-1)
overlays/octavia.yaml (+1/-1)
overlays/openstack-dashboard-ha.yaml (+0/-1)
overlays/swift-ha.yaml (+0/-2)
overlays/swift.yaml (+1/-1)
overlays/telemetry-ha.yaml (+0/-3)
overlays/telemetry-legacy-aodh.yaml (+2/-2)
overlays/telemetry-legacy.yaml (+1/-1)
overlays/telemetry.yaml (+2/-2)
swift/module_defaults (+13/-0)
swift/pipeline/01import-config-defaults (+6/-0)
swift/pipeline/02configure (+6/-14)
Reviewer Review Type Date Requested Status
Hemanth Nakkina Approve
Review via email: mp+380699@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Hemanth Nakkina (hemanth-n) wrote :

LGTM, verified few scenarios

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.module_defaults/ceph b/.module_defaults/ceph
2new file mode 120000
3index 0000000..faf6404
4--- /dev/null
5+++ b/.module_defaults/ceph
6@@ -0,0 +1 @@
7+../ceph/module_defaults
8\ No newline at end of file
9diff --git a/.module_defaults/kubernetes b/.module_defaults/kubernetes
10new file mode 120000
11index 0000000..1737714
12--- /dev/null
13+++ b/.module_defaults/kubernetes
14@@ -0,0 +1 @@
15+../kubernetes/module_defaults
16\ No newline at end of file
17diff --git a/.module_defaults/landscape b/.module_defaults/landscape
18new file mode 120000
19index 0000000..ccafb1a
20--- /dev/null
21+++ b/.module_defaults/landscape
22@@ -0,0 +1 @@
23+../landscape/module_defaults
24\ No newline at end of file
25diff --git a/.module_defaults/openstack b/.module_defaults/openstack
26new file mode 120000
27index 0000000..196dd1a
28--- /dev/null
29+++ b/.module_defaults/openstack
30@@ -0,0 +1 @@
31+../openstack/module_defaults
32\ No newline at end of file
33diff --git a/.module_defaults/swift b/.module_defaults/swift
34new file mode 120000
35index 0000000..ead6d4a
36--- /dev/null
37+++ b/.module_defaults/swift
38@@ -0,0 +1 @@
39+../swift/module_defaults
40\ No newline at end of file
41diff --git a/ceph/module_defaults b/ceph/module_defaults
42new file mode 100644
43index 0000000..c3715ad
44--- /dev/null
45+++ b/ceph/module_defaults
46@@ -0,0 +1,16 @@
47+# This file must contain defaults for all variables used in bundles/ovelays.
48+# They are used to render to final product in the event they are not provided
49+# elsewhere. It is inserted into the global context at the start of the
50+# pipeline.
51+#
52+# You can check that none are missing by running lint/check_var_defaults.sh
53+#
54+MOD_PARAMS[__OS_ORIGIN__]=$os_origin
55+MOD_PARAMS[__SOURCE__]=$source
56+MOD_PARAMS[__NUM_CEPH_MON_UNITS__]=1
57+MOD_PARAMS[__NUM_CEPH_FS_UNITS__]=1
58+MOD_PARAMS[__CEPH_INTERFACE__]='ceph-mon'
59+MOD_PARAMS[__SSL_CA__]=
60+MOD_PARAMS[__SSL_CERT__]=
61+MOD_PARAMS[__SSL_KEY__]=
62+MOD_PARAMS[__NUM_CEPH_RGW_UNITS__]=1
63diff --git a/ceph/pipeline/01setup b/ceph/pipeline/00setup
64similarity index 100%
65rename from ceph/pipeline/01setup
66rename to ceph/pipeline/00setup
67diff --git a/ceph/pipeline/01import-config-defaults b/ceph/pipeline/01import-config-defaults
68new file mode 100644
69index 0000000..be9c1f7
70--- /dev/null
71+++ b/ceph/pipeline/01import-config-defaults
72@@ -0,0 +1,6 @@
73+# Start with dependency defaults in case we want to override any locally
74+. ../.module_defaults/openstack
75+. ../.module_defaults/kubernetes # needed for etcd, easyrsa etc
76+
77+# Current module imports
78+. module_defaults
79diff --git a/ceph/pipeline/02configure b/ceph/pipeline/02configure
80index 514203e..88c63d2 100644
81--- a/ceph/pipeline/02configure
82+++ b/ceph/pipeline/02configure
83@@ -1,18 +1,10 @@
84-#!/bin/bash
85-# Bundle template parameters. These should correspond to variables set at the top
86-# of yaml bundle and overlay templates.
87-MOD_PARAMS[__OS_ORIGIN__]=$os_origin
88-MOD_PARAMS[__SOURCE__]=$source
89-MOD_PARAMS[__NUM_CEPH_MON_UNITS__]=1
90-MOD_PARAMS[__CEPH_INTERFACE__]='ceph-mon'
91-MOD_PARAMS[__NUM_VAULT_UNITS__]=1 # there are > 1 vault* overlay so need to use a global with default
92-MOD_PARAMS[__SSL_CA__]=
93-MOD_PARAMS[__SSL_CERT__]=
94-MOD_PARAMS[__SSL_KEY__]=
95-MOD_PARAMS[__NUM_ETCD_UNITS__]=1
96-MOD_PARAMS[__ETCD_SNAP_CHANNEL__]='latest/stable'
97-MOD_PARAMS[__GRAYLOG_SNAP_CHANNEL__]='3/stable'
98-MOD_PARAMS[__GRAFANA_SNAP_CHANNEL__]='stable'
99+#!/bin/bash -eu
100+# Global variables are first defined in 00setup and module
101+# dependencies are defined in 01import-config-defaults
102+#
103+# All overlay/bundle variables (MOD_PARAMS) defaults must go into
104+# the <module>/module_defaults file.
105+
106
107 # Skip processing input if it includes exclusive passthrough options
108 ! has_excl_passthrough_opt && \
109diff --git a/common/generate-bundle.sh b/common/generate-bundle.sh
110index 7c5e8e2..56bb41d 100755
111--- a/common/generate-bundle.sh
112+++ b/common/generate-bundle.sh
113@@ -1,6 +1,11 @@
114 #!/bin/bash -eu
115 LIB_COMMON=`dirname $0`/common
116 . $LIB_COMMON/helpers
117-. pipeline/01setup
118+. pipeline/00setup
119+. pipeline/01import-config-defaults
120 . pipeline/02configure
121 . pipeline/03build
122+# Ensure no unrendered variables
123+out="`grep -r __ b/${MASTER_OPTS[BUNDLE_NAME]} --exclude=config`"
124+[ -n "$out" ] || exit
125+echo -e "ERROR: there are unrendered variables in your bundle:\n$out"
126diff --git a/kubernetes/module_defaults b/kubernetes/module_defaults
127new file mode 100644
128index 0000000..7988f30
129--- /dev/null
130+++ b/kubernetes/module_defaults
131@@ -0,0 +1,23 @@
132+# This file must contain defaults for all variables used in bundles/ovelays.
133+# They are used to render to final product in the event they are not provided
134+# elsewhere. It is inserted into the global context at the start of the
135+# pipeline.
136+#
137+# You can check that none are missing by running lint/check_var_defaults.sh
138+#
139+MOD_PARAMS[__K8S_CHANNEL__]="latest/stable"
140+MOD_PARAMS[__NUM_ETCD_UNITS__]=1
141+MOD_PARAMS[__NUM_K8S_MASTER_UNITS__]=1
142+MOD_PARAMS[__NUM_K8S_WORKER_UNITS__]=2
143+MOD_PARAMS[__NUM_K8S_LB_UNITS__]=1
144+MOD_PARAMS[__ETCD_SNAP_CHANNEL__]='latest/stable'
145+MOD_PARAMS[__CHARM_CHANNEL__]=
146+
147+# NOTE: the k8s charms publish to stable and edge so its fine to default to
148+# edge but other charms e.g. openstack charms like ceph-mon do not so if
149+# they are used we must override and use stable.
150+if ! has_opt --charm-channel && \
151+ ! has_opt --use-stable-charms; then
152+ MOD_PARAMS[__CHARM_CHANNEL__]=edge
153+fi
154+
155diff --git a/kubernetes/pipeline/01setup b/kubernetes/pipeline/00setup
156similarity index 100%
157rename from kubernetes/pipeline/01setup
158rename to kubernetes/pipeline/00setup
159diff --git a/kubernetes/pipeline/01import-config-defaults b/kubernetes/pipeline/01import-config-defaults
160new file mode 100644
161index 0000000..e91dc0a
162--- /dev/null
163+++ b/kubernetes/pipeline/01import-config-defaults
164@@ -0,0 +1,6 @@
165+# Start with dependency defaults in case we want to override any locally
166+. ../.module_defaults/openstack # needed for vault
167+. ../.module_defaults/ceph
168+
169+# Current module imports
170+. module_defaults
171diff --git a/kubernetes/pipeline/02configure b/kubernetes/pipeline/02configure
172index 5468f9e..38f8d21 100644
173--- a/kubernetes/pipeline/02configure
174+++ b/kubernetes/pipeline/02configure
175@@ -1,26 +1,10 @@
176 #!/bin/bash -eu
177-# NOTE: global variables must be first defined in 01setup
178+# Global variables are first defined in 00setup and module
179+# dependencies are defined in 01import-config-defaults
180+#
181+# All overlay/bundle variables (MOD_PARAMS) defaults must go into
182+# the <module>/module_defaults file.
183
184-# Bundle template MOD_PARAMS. These should correspond to variables set at the top
185-# of yaml bundle and overlay templates.
186-MOD_PARAMS[__NUM_CEPH_MON_UNITS__]=1
187-MOD_PARAMS[__CEPH_INTERFACE__]='ceph-mon'
188-MOD_PARAMS[__K8S_CHANNEL__]="latest/stable"
189-MOD_PARAMS[__NUM_ETCD_UNITS__]=1
190-MOD_PARAMS[__NUM_K8S_MASTER_UNITS__]=1
191-MOD_PARAMS[__NUM_K8S_WORKER_UNITS__]=2
192-MOD_PARAMS[__NUM_VAULT_UNITS__]=1 # there are > 1 vault* overlay so need to use a global with default
193-MOD_PARAMS[__NUM_K8S_LB_UNITS__]=1
194-MOD_PARAMS[__ETCD_SNAP_CHANNEL__]='latest/stable'
195-MOD_PARAMS[__CHARM_CHANNEL__]=
196-
197-# NOTE: the k8s charms publish to stable and edge so its fine to default to
198-# edge but other charms e.g. openstack charms like ceph-mon do not so if
199-# they are used we must override and use stable.
200-if ! has_opt --charm-channel && \
201- ! has_opt --use-stable-charms; then
202- MOD_PARAMS[__CHARM_CHANNEL__]=edge
203-fi
204
205 # default for current stable is to use containerd
206 # See https://ubuntu.com/kubernetes/docs/container-runtime
207diff --git a/landscape/module_defaults b/landscape/module_defaults
208new file mode 100644
209index 0000000..4606ee6
210--- /dev/null
211+++ b/landscape/module_defaults
212@@ -0,0 +1,8 @@
213+# This file must contain defaults for all variables used in bundles/ovelays.
214+# They are used to render to final product in the event they are not provided
215+# elsewhere. It is inserted into the global context at the start of the
216+# pipeline.
217+#
218+# You can check that none are missing by running lint/check_var_defaults.sh
219+#
220+MOD_PARAMS[__LANDSCAPE_VERSION__]="19.01"
221diff --git a/landscape/pipeline/01setup b/landscape/pipeline/00setup
222similarity index 100%
223rename from landscape/pipeline/01setup
224rename to landscape/pipeline/00setup
225diff --git a/landscape/pipeline/01import-config-defaults b/landscape/pipeline/01import-config-defaults
226new file mode 100644
227index 0000000..d7def10
228--- /dev/null
229+++ b/landscape/pipeline/01import-config-defaults
230@@ -0,0 +1,4 @@
231+# Start with dependency defaults in case we want to override any locally
232+
233+# Current module imports
234+. module_defaults
235diff --git a/landscape/pipeline/02configure b/landscape/pipeline/02configure
236index dd7b9aa..27d8fe2 100644
237--- a/landscape/pipeline/02configure
238+++ b/landscape/pipeline/02configure
239@@ -1,7 +1,10 @@
240-#!/bin/bash
241-# NOTE: global variables must be first defined in 01setup
242+#!/bin/bash -eu
243+# Global variables are first defined in 00setup and module
244+# dependencies are defined in 01import-config-defaults
245+#
246+# All overlay/bundle variables (MOD_PARAMS) defaults must go into
247+# the <module>/module_defaults file.
248
249-MOD_PARAMS[__LANDSCAPE_VERSION__]="19.01"
250
251 # Skip processing input if it includes exclusive passthrough options
252 ! has_excl_passthrough_opt && \
253diff --git a/lint/check_var_defaults.sh b/lint/check_var_defaults.sh
254new file mode 100755
255index 0000000..bae4ed6
256--- /dev/null
257+++ b/lint/check_var_defaults.sh
258@@ -0,0 +1,14 @@
259+#!/bin/bash -eu
260+# Get all non-special variables from existing overlays and bundles
261+readarray -t vars<<<"`egrep -r ':.+__' overlays| egrep -v '__RESOURCES_PATH__|__SSL_|__VIP__|__SOURCE__|__OS_ORIGIN__'| sed -r 's/.+(__.+__).*/\1/g'| sort -u`"
262+# Get all module defaults
263+readarray -t mod_defaults<<<"`find .module_defaults -type l`"
264+echo "Checking ${#vars[@]} vars..."
265+for var in ${vars[@]}; do
266+ found=false
267+ for defs in ${mod_defaults[@]}; do
268+ egrep -q "^MOD_PARAMS\[$var\]" $defs && found=true
269+ done
270+ $found || echo "$var has no default"
271+done
272+echo "Done."
273diff --git a/openstack/module_defaults b/openstack/module_defaults
274new file mode 100644
275index 0000000..9f15c37
276--- /dev/null
277+++ b/openstack/module_defaults
278@@ -0,0 +1,49 @@
279+# This file must contain defaults for all variables used in bundles/ovelays.
280+# They are used to render to final product in the event they are not provided
281+# elsewhere. It is inserted into the global context at the start of the
282+# pipeline.
283+#
284+# You can check that none are missing by running lint/check_var_defaults.sh
285+#
286+MOD_PARAMS[__OS_ORIGIN__]=$os_origin
287+MOD_PARAMS[__SOURCE__]=$source
288+MOD_PARAMS[__NUM_BARBICAN_UNITS__]=1
289+MOD_PARAMS[__NUM_COMPUTE_UNITS__]=1
290+MOD_PARAMS[__NUM_NEUTRON_GATEWAY_UNITS__]=1
291+MOD_PARAMS[__NUM_AGENTS_PER_ROUTER__]=3
292+MOD_PARAMS[__NUM_VAULT_UNITS__]=1 # there are > 1 vault* overlay so need to use a global with default
293+MOD_PARAMS[__NUM_OCTAVIA_UNITS__]=1
294+MOD_PARAMS[__NUM_CINDER_UNITS__]=1
295+MOD_PARAMS[__NUM_DESIGNATE_UNITS__]=1
296+MOD_PARAMS[__NUM_GLANCE_UNITS__]=1
297+MOD_PARAMS[__NUM_HEAT_UNITS__]=1
298+MOD_PARAMS[__NUM_HORIZON_UNITS__]=1
299+MOD_PARAMS[__NUM_KEYSTONE_UNITS__]=1
300+MOD_PARAMS[__NUM_MYSQL_UNITS__]=1
301+MOD_PARAMS[__NUM_NEUTRON_API_UNITS__]=1
302+MOD_PARAMS[__NUM_NOVACC_UNITS__]=1
303+MOD_PARAMS[__NUM_RABBIT_UNITS__]=1
304+MOD_PARAMS[__NUM_TELEMETRY_UNITS__]=1
305+MOD_PARAMS[__NEUTRON_FW_DRIVER__]=openvswitch # legacy is iptables_hybrid
306+MOD_PARAMS[__SSL_CA__]=
307+MOD_PARAMS[__SSL_CERT__]=
308+MOD_PARAMS[__SSL_KEY__]=
309+MOD_PARAMS[__DVR_DATA_PORT__]=''
310+MOD_PARAMS[__OVN_DATA_PORT__]=''
311+MOD_PARAMS[__BIND_DNS_FORWARDER__]=`get_local_upstream_dns`
312+MOD_PARAMS[__ML2_DNS_FORWARDER__]=`get_local_upstream_dns`
313+MOD_PARAMS[__GRAYLOG_SNAP_CHANNEL__]='3/stable'
314+MOD_PARAMS[__GRAFANA_SNAP_CHANNEL__]='stable'
315+MOD_PARAMS[__OCTAVIA_RETROFIT_UCA__]='rocky' # charm defaults to rocky since it's the first version supported
316+MOD_PARAMS[__AMPHORA_SSH_PUB_KEY__]=''
317+MOD_PARAMS[__GSSS_SWIFT_ENABLED__]=false # glance-simplestreams-sync can optionally store index data in swift
318+MOD_PARAMS[__LDAP_SERVER__]=''
319+MOD_PARAMS[__OVERLAY_NETWORK_TYPE__]='gre' # this is the charm default
320+
321+# Try to use current model (or newly requested one) as subdomain name
322+model_subdomain=`get_juju_model`
323+[ -n "$model_subdomain" ] || model_subdomain="overcloud"
324+MOD_PARAMS[__DNS_DOMAIN__]="${model_subdomain}.stsstack.qa.1ss."
325+MOD_PARAMS[__DESIGNATE_NAMESERVERS__]="ns1.${MOD_PARAMS[__DNS_DOMAIN__]}"
326+
327+MOD_PARAMS[__CONSOLE_TYPE__]="novnc"
328diff --git a/openstack/openstack.yaml.template b/openstack/openstack.yaml.template
329index 3307488..35b1de1 100644
330--- a/openstack/openstack.yaml.template
331+++ b/openstack/openstack.yaml.template
332@@ -10,7 +10,6 @@ debug: &debug True
333 verbose: &verbose True
334 openstack_origin: &openstack_origin __OS_ORIGIN__
335 source: &source __SOURCE__
336-num_compute_units: &num_compute_units __NUM_COMPUTE_UNITS__
337
338 ssl_ca: &ssl_ca __SSL_CA__
339 ssl_cert: &ssl_cert __SSL_CERT__
340@@ -19,13 +18,14 @@ ssl_key: &ssl_key __SSL_KEY__
341 series: __SERIES__
342 applications:
343 rabbitmq-server:
344- num_units: 1
345+ num_units: __NUM_RABBIT_UNITS__
346 charm: cs:~openstack-charmers-next/rabbitmq-server
347 constraints: mem=1G
348 options:
349 source: *source
350+ min-cluster-size: __NUM_RABBIT_UNITS__
351 keystone:
352- num_units: 1
353+ num_units: __NUM_KEYSTONE_UNITS__
354 charm: cs:~openstack-charmers-next/keystone
355 constraints: mem=1G
356 options:
357@@ -39,7 +39,7 @@ applications:
358 ssl_key: *ssl_key
359 nova-compute:
360 charm: cs:~openstack-charmers-next/nova-compute
361- num_units: *num_compute_units
362+ num_units: __NUM_COMPUTE_UNITS__
363 constraints: mem=4G
364 options:
365 debug: *debug
366@@ -50,7 +50,7 @@ applications:
367 openstack-origin: *openstack_origin
368 force-raw-images: false # disable for stsstack since conversion kills the disks and is not needed
369 nova-cloud-controller:
370- num_units: 1
371+ num_units: __NUM_NOVACC_UNITS__
372 charm: cs:~openstack-charmers-next/nova-cloud-controller
373 constraints: mem=2G
374 options:
375@@ -62,7 +62,7 @@ applications:
376 ssl_cert: *ssl_cert
377 ssl_key: *ssl_key
378 neutron-api:
379- num_units: 1
380+ num_units: __NUM_NEUTRON_API_UNITS__
381 charm: cs:~openstack-charmers-next/neutron-api
382 constraints: mem=1G
383 options:
384@@ -77,7 +77,7 @@ applications:
385 ssl_cert: *ssl_cert
386 ssl_key: *ssl_key
387 cinder:
388- num_units: 1
389+ num_units: __NUM_CINDER_UNITS__
390 constraints: mem=2G
391 charm: cs:~openstack-charmers-next/cinder
392 options:
393@@ -92,7 +92,7 @@ applications:
394 ssl_cert: *ssl_cert
395 ssl_key: *ssl_key
396 glance:
397- num_units: 1
398+ num_units: __NUM_GLANCE_UNITS__
399 charm: cs:~openstack-charmers-next/glance
400 constraints: mem=1G
401 options:
402diff --git a/openstack/pipeline/01setup b/openstack/pipeline/00setup
403similarity index 100%
404rename from openstack/pipeline/01setup
405rename to openstack/pipeline/00setup
406diff --git a/openstack/pipeline/01import-config-defaults b/openstack/pipeline/01import-config-defaults
407new file mode 100644
408index 0000000..e49ecc4
409--- /dev/null
410+++ b/openstack/pipeline/01import-config-defaults
411@@ -0,0 +1,7 @@
412+# Start with dependency defaults in case we want to override any locally
413+. ../.module_defaults/ceph
414+. ../.module_defaults/swift
415+. ../.module_defaults/kubernetes # needed for etcd, easyrsa etc
416+
417+# Current module imports
418+. module_defaults
419diff --git a/openstack/pipeline/02configure b/openstack/pipeline/02configure
420index 478b3b1..1e2e3ff 100644
421--- a/openstack/pipeline/02configure
422+++ b/openstack/pipeline/02configure
423@@ -1,46 +1,13 @@
424-#!/bin/bash
425-# NOTE: global variables must be first defined in 01setup
426+#!/bin/bash -eu
427+# Global variables are first defined in 00setup and module
428+# dependencies are defined in 01import-config-defaults
429+#
430+# All overlay/bundle variables (MOD_PARAMS) defaults must go into
431+# the <module>/module_defaults file.
432
433-# Bundle template MOD_PARAMS. These should correspond to variables set at the top
434-# of yaml bundle and overlay templates.
435-MOD_PARAMS[__OS_ORIGIN__]=$os_origin
436-MOD_PARAMS[__SOURCE__]=$source
437-MOD_PARAMS[__NUM_BARBICAN_UNITS__]=1
438-MOD_PARAMS[__NUM_COMPUTE_UNITS__]=1
439-MOD_PARAMS[__NUM_CEPH_MON_UNITS__]=1
440-MOD_PARAMS[__NUM_CEPH_FS_UNITS__]=1
441-MOD_PARAMS[__CEPH_INTERFACE__]='ceph-mon'
442-MOD_PARAMS[__NUM_NEUTRON_GATEWAY_UNITS__]=1
443-MOD_PARAMS[__NUM_VAULT_UNITS__]=1 # there are > 1 vault* overlay so need to use a global with default
444-MOD_PARAMS[__NUM_ETCD_UNITS__]=1
445-MOD_PARAMS[__NUM_OCTAVIA_UNITS__]=1
446-MOD_PARAMS[__NEUTRON_FW_DRIVER__]=openvswitch # legacy is iptables_hybrid
447-MOD_PARAMS[__SSL_CA__]=
448-MOD_PARAMS[__SSL_CERT__]=
449-MOD_PARAMS[__SSL_KEY__]=
450-MOD_PARAMS[__DVR_DATA_PORT__]=''
451-MOD_PARAMS[__OVN_DATA_PORT__]=''
452-MOD_PARAMS[__BIND_DNS_FORWARDER__]=`get_local_upstream_dns`
453-MOD_PARAMS[__ML2_DNS_FORWARDER__]=`get_local_upstream_dns`
454-MOD_PARAMS[__ETCD_SNAP_CHANNEL__]='latest/stable'
455-MOD_PARAMS[__GRAYLOG_SNAP_CHANNEL__]='3/stable'
456-MOD_PARAMS[__GRAFANA_SNAP_CHANNEL__]='stable'
457-MOD_PARAMS[__OCTAVIA_RETROFIT_UCA__]='rocky' # charm defaults to rocky since it's the first version supported
458-MOD_PARAMS[__AMPHORA_SSH_PUB_KEY__]=''
459-MOD_PARAMS[__GSSS_SWIFT_ENABLED__]=false # glance-simplestreams-sync can optionally store index data in swift
460-MOD_PARAMS[__LDAP_SERVER__]=''
461-MOD_PARAMS[__OVERLAY_NETWORK_TYPE__]='gre' # this is the charm default
462
463-# Try to use current model (or newly requested one) as subdomain name
464-model_subdomain=`get_juju_model`
465-[ -n "$model_subdomain" ] || model_subdomain="overcloud"
466-MOD_PARAMS[__DNS_DOMAIN__]="${model_subdomain}.stsstack.qa.1ss."
467-MOD_PARAMS[__DESIGNATE_NAMESERVERS__]="ns1.${MOD_PARAMS[__DNS_DOMAIN__]}"
468-
469-MOD_PARAMS[__CONSOLE_TYPE__]="novnc"
470 # If using any variant of dvr-snat, there is no need for a neutron-gateway.
471 # We also don't currently need it when using ovn
472-
473 is_neutron_gateway_required ()
474 {
475 if ! has_opt --dvr-snat* && ! has_opt --ovn; then
476@@ -331,7 +298,6 @@ do
477 ;;
478 --rabbitmq-server-ha*)
479 get_units $1 __NUM_RABBIT_UNITS__ 3
480- MOD_OVERLAYS+=( "rabbitmq-server-ha.yaml" )
481 ;;
482 --rsyslog)
483 MOD_OVERLAYS+=( "rsyslog.yaml" )
484diff --git a/overlays/ceph-rgw-ha.yaml b/overlays/ceph-rgw-ha.yaml
485index f7abb5b..d3050fc 100644
486--- a/overlays/ceph-rgw-ha.yaml
487+++ b/overlays/ceph-rgw-ha.yaml
488@@ -1,11 +1,9 @@
489 applications:
490 ceph-rgw:
491- num_units: __NUM_CEPH_RGW_UNITS__
492 options:
493 vip: __VIP__
494 ceph-rgw-hacluster:
495 charm: cs:~openstack-charmers-next/hacluster
496- num_units: 0
497 options:
498 cluster_count: __NUM_CEPH_RGW_UNITS__
499 relations:
500diff --git a/overlays/ceph-rgw.yaml b/overlays/ceph-rgw.yaml
501index f75f23f..ba83bb1 100644
502--- a/overlays/ceph-rgw.yaml
503+++ b/overlays/ceph-rgw.yaml
504@@ -11,7 +11,7 @@ ssl_key: &ssl_key __SSL_KEY__
505 applications:
506 ceph-rgw:
507 charm: cs:~openstack-charmers-next/ceph-radosgw
508- num_units: 1
509+ num_units: __NUM_CEPH_RGW_UNITS__
510 constraints: mem=1G
511 options:
512 loglevel: *loglevel
513diff --git a/overlays/cinder-ha.yaml b/overlays/cinder-ha.yaml
514index f7e45f9..815bba9 100644
515--- a/overlays/cinder-ha.yaml
516+++ b/overlays/cinder-ha.yaml
517@@ -1,6 +1,5 @@
518 applications:
519 cinder:
520- num_units: __NUM_CINDER_UNITS__
521 options:
522 vip: __VIP__
523 cinder-hacluster:
524diff --git a/overlays/designate-ha.yaml b/overlays/designate-ha.yaml
525index 29bb022..bd9bcb2 100644
526--- a/overlays/designate-ha.yaml
527+++ b/overlays/designate-ha.yaml
528@@ -1,6 +1,5 @@
529 applications:
530 designate:
531- num_units: __NUM_DESIGNATE_UNITS__
532 options:
533 vip: __VIP__
534 designate-bind:
535diff --git a/overlays/designate.yaml b/overlays/designate.yaml
536index c90b26d..85603d3 100644
537--- a/overlays/designate.yaml
538+++ b/overlays/designate.yaml
539@@ -6,7 +6,7 @@ openstack_origin: &openstack_origin __OS_ORIGIN__
540 applications:
541 designate:
542 charm: cs:~openstack-charmers-next/designate
543- num_units: 1
544+ num_units: __NUM_DESIGNATE_UNITS__
545 constraints: mem=2G
546 options:
547 debug: *debug
548diff --git a/overlays/glance-ha.yaml b/overlays/glance-ha.yaml
549index 00992f5..cc4ebd4 100644
550--- a/overlays/glance-ha.yaml
551+++ b/overlays/glance-ha.yaml
552@@ -1,6 +1,5 @@
553 applications:
554 glance:
555- num_units: __NUM_GLANCE_UNITS__
556 options:
557 vip: __VIP__
558 glance-hacluster:
559diff --git a/overlays/gnocchi.yaml b/overlays/gnocchi.yaml
560index 6fa5768..1c67a1f 100644
561--- a/overlays/gnocchi.yaml
562+++ b/overlays/gnocchi.yaml
563@@ -6,7 +6,7 @@ openstack_origin: &openstack_origin __OS_ORIGIN__
564 applications:
565 gnocchi:
566 charm: cs:~openstack-charmers-next/gnocchi
567- num_units: 1
568+ num_units: __NUM_TELEMETRY_UNITS__
569 constraints: mem=1G
570 options:
571 debug: *debug
572diff --git a/overlays/heat-ha.yaml b/overlays/heat-ha.yaml
573index e0531fa..d811c3f 100644
574--- a/overlays/heat-ha.yaml
575+++ b/overlays/heat-ha.yaml
576@@ -1,6 +1,5 @@
577 applications:
578 heat:
579- num_units: __NUM_HEAT_UNITS__
580 options:
581 vip: __VIP__
582 heat-hacluster:
583diff --git a/overlays/heat.yaml b/overlays/heat.yaml
584index c051270..272aa93 100644
585--- a/overlays/heat.yaml
586+++ b/overlays/heat.yaml
587@@ -6,7 +6,7 @@ openstack_origin: &openstack_origin __OS_ORIGIN__
588 applications:
589 heat:
590 charm: cs:~openstack-charmers-next/heat
591- num_units: 1
592+ num_units: __NUM_HEAT_UNITS__
593 constraints: mem=1G
594 options:
595 debug: *debug
596diff --git a/overlays/keystone-ha.yaml b/overlays/keystone-ha.yaml
597index 8d96054..0154a5d 100644
598--- a/overlays/keystone-ha.yaml
599+++ b/overlays/keystone-ha.yaml
600@@ -1,6 +1,5 @@
601 applications:
602 keystone:
603- num_units: __NUM_KEYSTONE_UNITS__
604 options:
605 vip: __VIP__
606 keystone-hacluster:
607diff --git a/overlays/mysql-ha.yaml b/overlays/mysql-ha.yaml
608index 9e3fe79..6d86999 100644
609--- a/overlays/mysql-ha.yaml
610+++ b/overlays/mysql-ha.yaml
611@@ -1,9 +1,7 @@
612 applications:
613 mysql:
614- num_units: __NUM_MYSQL_UNITS__
615 options:
616 vip: __VIP__
617- min-cluster-size: __NUM_MYSQL_UNITS__
618 mysql-hacluster:
619 charm: cs:~openstack-charmers-next/hacluster
620 options:
621diff --git a/overlays/mysql.yaml b/overlays/mysql.yaml
622index b416801..30ad271 100644
623--- a/overlays/mysql.yaml
624+++ b/overlays/mysql.yaml
625@@ -3,7 +3,7 @@ source: &source __OS_ORIGIN__
626
627 applications:
628 mysql:
629- num_units: 1
630+ num_units: __NUM_MYSQL_UNITS__
631 charm: cs:~openstack-charmers-next/percona-cluster
632 constraints: mem=4G
633 options:
634@@ -12,3 +12,4 @@ applications:
635 max-connections: 20000
636 root-password: ChangeMe123
637 sst-password: ChangeMe123
638+ min-cluster-size: __NUM_MYSQL_UNITS__
639diff --git a/overlays/neutron-api-ha.yaml b/overlays/neutron-api-ha.yaml
640index d6daa3f..77f5b21 100644
641--- a/overlays/neutron-api-ha.yaml
642+++ b/overlays/neutron-api-ha.yaml
643@@ -1,6 +1,5 @@
644 applications:
645 neutron-api:
646- num_units: __NUM_NEUTRON_API_UNITS__
647 options:
648 vip: __VIP__
649 neutron-api-hacluster:
650diff --git a/overlays/nova-cloud-controller-ha.yaml b/overlays/nova-cloud-controller-ha.yaml
651index 1aa0025..e40343b 100644
652--- a/overlays/nova-cloud-controller-ha.yaml
653+++ b/overlays/nova-cloud-controller-ha.yaml
654@@ -1,6 +1,5 @@
655 applications:
656 nova-cloud-controller:
657- num_units: __NUM_NOVACC_UNITS__
658 options:
659 vip: __VIP__
660 nova-cloud-controller-hacluster:
661diff --git a/overlays/octavia-dashboard.yaml b/overlays/octavia-dashboard.yaml
662index e882f5c..3102c06 100644
663--- a/overlays/octavia-dashboard.yaml
664+++ b/overlays/octavia-dashboard.yaml
665@@ -3,5 +3,6 @@
666 applications:
667 octavia-dashboard:
668 charm: cs:~openstack-charmers-next/octavia-dashboard
669+ num_units: __NUM_HORIZON_UNITS__
670 relations:
671 - [ octavia-dashboard:dashboard, openstack-dashboard:dashboard-plugin ]
672diff --git a/overlays/octavia-ha.yaml b/overlays/octavia-ha.yaml
673index 190e624..f54edb1 100644
674--- a/overlays/octavia-ha.yaml
675+++ b/overlays/octavia-ha.yaml
676@@ -1,6 +1,5 @@
677 applications:
678 octavia:
679- num_units: __NUM_OCTAVIA_UNITS__
680 options:
681 vip: __VIP__
682 octavia-hacluster:
683diff --git a/overlays/octavia.yaml b/overlays/octavia.yaml
684index d1b3e0f..7f6ba84 100644
685--- a/overlays/octavia.yaml
686+++ b/overlays/octavia.yaml
687@@ -5,7 +5,7 @@ openstack_origin: &openstack_origin __OS_ORIGIN__
688 applications:
689 octavia:
690 charm: cs:~openstack-charmers-next/octavia
691- num_units: 1
692+ num_units: __NUM_OCTAVIA_UNITS__
693 options:
694 debug: *debug
695 openstack-origin: __OS_ORIGIN__
696diff --git a/overlays/openstack-dashboard-ha.yaml b/overlays/openstack-dashboard-ha.yaml
697index 7fb355e..4d80a2b 100644
698--- a/overlays/openstack-dashboard-ha.yaml
699+++ b/overlays/openstack-dashboard-ha.yaml
700@@ -1,6 +1,5 @@
701 applications:
702 openstack-dashboard:
703- num_units: __NUM_HORIZON_UNITS__
704 options:
705 vip: __VIP__
706 openstack-dashboard-hacluster:
707diff --git a/overlays/rabbitmq-server-ha.yaml b/overlays/rabbitmq-server-ha.yaml
708deleted file mode 100644
709index 8a78a22..0000000
710--- a/overlays/rabbitmq-server-ha.yaml
711+++ /dev/null
712@@ -1,6 +0,0 @@
713-applications:
714- rabbitmq-server:
715- num_units: __NUM_RABBIT_UNITS__
716- options:
717- min-cluster-size: __NUM_RABBIT_UNITS__
718-
719diff --git a/overlays/swift-ha.yaml b/overlays/swift-ha.yaml
720index fad248a..1166ffa 100644
721--- a/overlays/swift-ha.yaml
722+++ b/overlays/swift-ha.yaml
723@@ -1,11 +1,9 @@
724 applications:
725 swift-proxy:
726- num_units: __NUM_SWIFT_PROXY_UNITS__
727 options:
728 vip: __VIP__
729 swift-proxy-hacluster:
730 charm: cs:~openstack-charmers-next/hacluster
731- num_units: 0
732 options:
733 cluster_count: __NUM_SWIFT_PROXY_UNITS__
734 relations:
735diff --git a/overlays/swift.yaml b/overlays/swift.yaml
736index 9d69761..8229ca3 100644
737--- a/overlays/swift.yaml
738+++ b/overlays/swift.yaml
739@@ -7,7 +7,7 @@ ssl_key: &ssl_key __SSL_KEY__
740
741 applications:
742 swift-proxy:
743- num_units: 1
744+ num_units: __NUM_SWIFT_PROXY_UNITS__
745 charm: cs:~openstack-charmers-next/swift-proxy
746 constraints: mem=1G
747 options:
748diff --git a/overlays/telemetry-ha.yaml b/overlays/telemetry-ha.yaml
749index 21bdc5a..0fa7331 100644
750--- a/overlays/telemetry-ha.yaml
751+++ b/overlays/telemetry-ha.yaml
752@@ -1,14 +1,11 @@
753 applications:
754 ceilometer:
755- num_units: __NUM_TELEMETRY_UNITS__
756 options:
757 vip: __VIP__
758 aodh:
759- num_units: __NUM_TELEMETRY_UNITS__
760 options:
761 vip: __VIP__
762 gnocchi:
763- num_units: __NUM_TELEMETRY_UNITS__
764 options:
765 vip: __VIP__
766 ceilometer-hacluster:
767diff --git a/overlays/telemetry-legacy-aodh.yaml b/overlays/telemetry-legacy-aodh.yaml
768index 579f439..09dd655 100644
769--- a/overlays/telemetry-legacy-aodh.yaml
770+++ b/overlays/telemetry-legacy-aodh.yaml
771@@ -6,7 +6,7 @@ openstack_origin: &openstack_origin __OS_ORIGIN__
772 applications:
773 ceilometer:
774 charm: cs:~openstack-charmers-next/ceilometer
775- num_units: 1
776+ num_units: __NUM_TELEMETRY_UNITS__
777 constraints: mem=1G
778 options:
779 debug: *debug
780@@ -16,7 +16,7 @@ applications:
781 charm: cs:~openstack-charmers-next/ceilometer-agent
782 aodh:
783 charm: cs:~openstack-charmers-next/aodh
784- num_units: 1
785+ num_units: __NUM_TELEMETRY_UNITS__
786 constraints: mem=1G
787 options:
788 debug: *debug
789diff --git a/overlays/telemetry-legacy.yaml b/overlays/telemetry-legacy.yaml
790index cc198a4..6638b98 100644
791--- a/overlays/telemetry-legacy.yaml
792+++ b/overlays/telemetry-legacy.yaml
793@@ -6,7 +6,7 @@ openstack_origin: &openstack_origin __OS_ORIGIN__
794 applications:
795 ceilometer:
796 charm: cs:~openstack-charmers-next/ceilometer
797- num_units: 1
798+ num_units: __NUM_TELEMETRY_UNITS__
799 constraints: mem=1G
800 options:
801 debug: *debug
802diff --git a/overlays/telemetry.yaml b/overlays/telemetry.yaml
803index c3bb0fb..0f48459 100644
804--- a/overlays/telemetry.yaml
805+++ b/overlays/telemetry.yaml
806@@ -6,7 +6,7 @@ openstack_origin: &openstack_origin __OS_ORIGIN__
807 applications:
808 ceilometer:
809 charm: cs:~openstack-charmers-next/ceilometer
810- num_units: 1
811+ num_units: __NUM_TELEMETRY_UNITS__
812 constraints: mem=1G
813 options:
814 debug: *debug
815@@ -16,7 +16,7 @@ applications:
816 charm: cs:~openstack-charmers-next/ceilometer-agent
817 aodh:
818 charm: cs:~openstack-charmers-next/aodh
819- num_units: 1
820+ num_units: __NUM_TELEMETRY_UNITS__
821 constraints: mem=1G
822 options:
823 debug: *debug
824diff --git a/swift/module_defaults b/swift/module_defaults
825new file mode 100644
826index 0000000..71a5e90
827--- /dev/null
828+++ b/swift/module_defaults
829@@ -0,0 +1,13 @@
830+# This file must contain defaults for all variables used in bundles/ovelays.
831+# They are used to render to final product in the event they are not provided
832+# elsewhere. It is inserted into the global context at the start of the
833+# pipeline.
834+#
835+# You can check that none are missing by running lint/check_var_defaults.sh
836+#
837+MOD_PARAMS[__OS_ORIGIN__]=$os_origin
838+MOD_PARAMS[__SOURCE__]=$source
839+MOD_PARAMS[__SSL_CA__]=
840+MOD_PARAMS[__SSL_CERT__]=
841+MOD_PARAMS[__SSL_KEY__]=
842+MOD_PARAMS[__NUM_SWIFT_PROXY_UNITS__]=1
843diff --git a/swift/pipeline/01setup b/swift/pipeline/00setup
844similarity index 100%
845rename from swift/pipeline/01setup
846rename to swift/pipeline/00setup
847diff --git a/swift/pipeline/01import-config-defaults b/swift/pipeline/01import-config-defaults
848new file mode 100644
849index 0000000..be9c1f7
850--- /dev/null
851+++ b/swift/pipeline/01import-config-defaults
852@@ -0,0 +1,6 @@
853+# Start with dependency defaults in case we want to override any locally
854+. ../.module_defaults/openstack
855+. ../.module_defaults/kubernetes # needed for etcd, easyrsa etc
856+
857+# Current module imports
858+. module_defaults
859diff --git a/swift/pipeline/02configure b/swift/pipeline/02configure
860index fe72467..bdcdb59 100644
861--- a/swift/pipeline/02configure
862+++ b/swift/pipeline/02configure
863@@ -1,18 +1,10 @@
864-#!/bin/bash
865-# NOTE: global variables must be first defined in 01setup
866+#!/bin/bash -eu
867+# Global variables are first defined in 00setup and module
868+# dependencies are defined in 01import-config-defaults
869+#
870+# All overlay/bundle variables (MOD_PARAMS) defaults must go into
871+# the <module>/module_defaults file.
872
873-# Bundle template parameters. These should correspond to variables set at the top
874-# of yaml bundle and overlay templates.
875-MOD_PARAMS[__OS_ORIGIN__]=$os_origin
876-MOD_PARAMS[__SOURCE__]=$source
877-MOD_PARAMS[__NUM_VAULT_UNITS__]=1 # there are > 1 vault* overlay so need to use a global with default
878-MOD_PARAMS[__SSL_CA__]=
879-MOD_PARAMS[__SSL_CERT__]=
880-MOD_PARAMS[__SSL_KEY__]=
881-MOD_PARAMS[__NUM_ETCD_UNITS__]=1
882-MOD_PARAMS[__ETCD_SNAP_CHANNEL__]='latest/stable'
883-MOD_PARAMS[__GRAYLOG_SNAP_CHANNEL__]='3/stable'
884-MOD_PARAMS[__GRAFANA_SNAP_CHANNEL__]='stable'
885
886 # We always add this overlay since it contains core apps for this module.
887 MOD_OVERLAYS+=( swift.yaml )

Subscribers

People subscribed via source and target branches