Fix create sasl account before config file is ready

Add checking for container readiness before create sasl user

Closes-Bug: #2015589
Change-Id: Ic650ba6be1f192e3cbeaa94de3d00507636c1c92
This commit is contained in:
gamerslouis 2023-04-08 01:58:16 +08:00
parent 717eb8c14f
commit 46415123d5
2 changed files with 18 additions and 1 deletions

View File

@ -93,7 +93,7 @@
vars:
service_name: "nova-libvirt"
service: "{{ nova_cell_services[service_name] }}"
nova_libvirt_notify: "{{ ['Create libvirt SASL user'] if libvirt_enable_sasl | bool else [] }}"
nova_libvirt_notify: "{{ ['Checking libvirt container is ready', 'Create libvirt SASL user'] if libvirt_enable_sasl | bool else [] }}"
become: true
kolla_docker:
action: "recreate_or_restart_container"
@ -115,6 +115,18 @@
- kolla_action != "config"
notify: "{{ nova_libvirt_notify }}"
# need to wait kolla_set_configs script to overwrite sasl config file
- name: Checking libvirt container is ready
become: true
shell:
cmd: >
set -o pipefail &&
{{ kolla_container_engine }} exec -i nova_libvirt ls /run/libvirtd.pid
executable: /bin/bash
register: libvirt_container_ready
until: libvirt_container_ready is succeeded
retries: 10
# The SASL user needs to exist in order for nova-compute to start successfully.
- name: Create libvirt SASL user
become: true

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes create sasl account before config file is ready.
`LP#2015589 <https://launchpad.net/bugs/2015589>`__