Skip to content

Commit 438d8e6

Browse files
Merge pull request #1098 from sathlan/update-kpatch
[update] Support passing AnsibleExtraVars to the update CR: kpatch.
2 parents b408e4e + a41fbcf commit 438d8e6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/openstack-update.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ set -ex
1818
CONTAINERS_NAMESPACE=${CONTAINERS_NAMESPACE:-podified-antelope-centos9}
1919
CONTAINERS_TARGET_TAG=${CONTAINERS_TARGET_TAG:-current-podified}
2020
FAKE_UPDATE=${FAKE_UPDATE:-false}
21+
KPATCH_UPDATE=${KPATCH_UPDATE:-false}
2122
OPENSTACK_VERSION=${OPENSTACK_VERSION:-0.0.2}
2223
OUTFILE=${OUTFILE:-csv.yaml}
2324
TIMEOUT=${TIMEOUT:-1000s}
@@ -141,6 +142,20 @@ echo "MinorUpdateControlplane completed"
141142
# start data plane plane update for rest of edpm services
142143
DATAPLANE_NODESETS=$(oc get openstackdataplanenodeset -o name | awk -F'/' '{print " - " $2}')
143144

145+
ansible_extra_vars_list=()
146+
if [ "${KPATCH_UPDATE}" != "false" ]; then
147+
ansible_extra_vars_list+=('edpm_update_enable_kpatch: "true"')
148+
fi
149+
150+
ANSIBLE_EXTRA_VARS=""
151+
if [ ${#ansible_extra_vars_list[@]} -gt 0 ]; then
152+
ANSIBLE_EXTRA_VARS=" ansibleExtraVars:"
153+
for var in "${ansible_extra_vars_list[@]}"; do
154+
ANSIBLE_EXTRA_VARS+=$'\n '"${var}"
155+
done
156+
fi
157+
158+
144159
cat <<EOF >edpm-deployment-update.yaml
145160
apiVersion: dataplane.openstack.org/v1beta1
146161
kind: OpenStackDataPlaneDeployment
@@ -151,6 +166,7 @@ spec:
151166
$DATAPLANE_NODESETS
152167
servicesOverride:
153168
- update
169+
$ANSIBLE_EXTRA_VARS
154170
EOF
155171

156172
update_event Applying the UPDATE CRD

0 commit comments

Comments
 (0)