Skip to content

Commit

Permalink
Support post gen edpm kustomize scripts
Browse files Browse the repository at this point in the history
This patch introduces a mechanism to run an arbitrary script on the
`edpm_deploy_prep` target after the `kustomization.yaml` file has been
created by the `gen-edpm-kustomize.sh` script.

This provides a flexible mechanism to modify things in the kustomization
that are not currently possible.

An example is to use a different ansible host for deployment than the IP
that will be used as the `ctlplane` network IP.

The variable used to define the location of the script is
`EDPM_POST_GEN_SCRIPT`.

Example of usage:

```
$ make edpm_deploy \
  DATAPLANE_POST_GEN_SCRIPT="$(realpath ./scripts/change-ansible-hosts.sh)"
```

And the contents of `change-ansible-hosts.sh` are:

```
sed -i "s/value: 192.168.122.100/value: 192.168.1.13/" kustomization.yaml
```
  • Loading branch information
Akrog committed Nov 29, 2024
1 parent f137573 commit 3c536f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ edpm_deploy_prep: export BRANCH=${OPENSTACK_BRANCH}
edpm_deploy_prep: export HASH=${OPENSTACK_COMMIT_HASH}
edpm_deploy_prep: export EDPM_TLS_ENABLED=${DATAPLANE_TLS_ENABLED}
edpm_deploy_prep: export EDPM_NOVA_NFS_PATH=${DATAPLANE_NOVA_NFS_PATH}
edpm_deploy_prep: export EDPM_POST_GEN_SCRIPT=${DATAPLANE_POST_GEN_SCRIPT}
ifeq ($(NETWORK_BGP), true)
ifeq ($(BGP_OVN_ROUTING), true)
edpm_deploy_prep: export BGP=ovn
Expand Down
4 changes: 4 additions & 0 deletions scripts/gen-edpm-kustomize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,8 @@ fi

kustomization_add_resources

if [ -n "${EDPM_POST_GEN_SCRIPT}" ]; then
. "${EDPM_POST_GEN_SCRIPT}"
fi

popd

0 comments on commit 3c536f7

Please sign in to comment.