From bc98c494aecf84ddae070502b00de0b9db97c5dd Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Mon, 25 Sep 2023 13:55:07 +0100 Subject: [PATCH] Generate KA config before ``kolla ansible run`` Supports calling custom Kolla Ansible commands directly after a ``kayobe control host bootstrap``. Change-Id: I19f188cc002f8578618003e90c0a4a154b806e49 --- dev/functions | 3 ++- kayobe/cli/commands.py | 5 +++++ ...generate-ka-config-on-ka-run-8ff96b27017b2c62.yaml | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/generate-ka-config-on-ka-run-8ff96b27017b2c62.yaml diff --git a/dev/functions b/dev/functions index 8614897d0..8dbaaee85 100644 --- a/dev/functions +++ b/dev/functions @@ -436,7 +436,8 @@ function overcloud_deploy { run_kayobe kolla ansible run certificates \ --kolla-extra kolla_certificates_dir=${KAYOBE_CONFIG_PATH}/kolla/certificates \ --kolla-extra ansible_user=$USER \ - --kolla-extra ansible_python_interpreter=/usr/bin/python3 + --kolla-extra ansible_python_interpreter=/usr/bin/python3 \ + --skip-tags kolla-openstack unset ANSIBLE_CACHE_PLUGIN # Add CA cert to trust store. diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index 464d83b0e..433295329 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -373,6 +373,11 @@ class KollaAnsibleRun(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, def take_action(self, parsed_args): self.app.LOG.debug("Running Kolla Ansible command") + + # First prepare configuration. + self.generate_kolla_ansible_config(parsed_args) + + # Run the kolla-ansible command. self.run_kolla_ansible(parsed_args, parsed_args.command, parsed_args.kolla_inventory_filename) diff --git a/releasenotes/notes/generate-ka-config-on-ka-run-8ff96b27017b2c62.yaml b/releasenotes/notes/generate-ka-config-on-ka-run-8ff96b27017b2c62.yaml new file mode 100644 index 000000000..eef8cd394 --- /dev/null +++ b/releasenotes/notes/generate-ka-config-on-ka-run-8ff96b27017b2c62.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + ``kayobe kolla ansible run`` will now generate Kolla-Ansible configuration + before the command is run. You can use ``--skip-tags kolla-openstack`` to + skip this for commands that do not require the kolla config. +upgrade: + - | + ``kayobe kolla ansible run`` will now generate Kolla-Ansible configuration + before the command is run. You can use ``--skip-tags kolla-openstack`` to + skip this for commands that do not require the kolla config.