Fix Octavia cert generation

I have no clue how it worked previously in CI, but now
it's using default path to the inventory - which does
not exist.

In addition to that, type=int in cliff will default to
None, so the check had to be rewritten - because we
always did cert expiry check instead of generating them.

Change-Id: I84d71558c2666ba2cfa47054f782d25ff0c1f691
This commit is contained in:
Michal Nasiadka 2024-10-31 10:50:27 +01:00 committed by Michal Arbet
parent 04873199ef
commit cd8ecfc8f2
3 changed files with 4 additions and 3 deletions

View File

@ -201,7 +201,8 @@ class OctaviaCertificates(KollaAnsibleMixin, Command):
def take_action(self, parsed_args):
extra_vars = {}
if hasattr(parsed_args, "check_expiry"):
if hasattr(parsed_args, "check_expiry") \
and parsed_args.check_expiry is not None:
self.app.LOG.info("Checking if certificates expire "
"within given number of days.")
extra_vars["octavia_certs_check_expiry"] = "yes"

View File

@ -323,7 +323,7 @@
- name: Create TLS certificates for octavia
shell: |
source {{ kolla_ansible_venv_path }}/bin/activate
kolla-ansible octavia-certificates
kolla-ansible octavia-certificates -i {{ kolla_inventory_path }} -vvvv
when: scenario in ['octavia']
args:
executable: /bin/bash

View File

@ -11,7 +11,7 @@ export PYTHONUNBUFFERED=1
function check_certificate_expiry {
RAW_INVENTORY=/etc/kolla/inventory
source $KOLLA_ANSIBLE_VENV_PATH/bin/activate
kolla-ansible octavia-certificates --check-expiry 7
kolla-ansible octavia-certificates -i ${RAW_INVENTORY} --check-expiry 7
deactivate
}