Merge "Fix logic of discovering hosts by service" into stable/2023.1

This commit is contained in:
Zuul 2023-10-20 13:54:38 +00:00 committed by Gerrit Code Review
commit f3eeb7a7f8
3 changed files with 11 additions and 1 deletions

View File

@ -291,6 +291,7 @@ nova_console_type: "{{ (ansible_facts['architecture'] == 'aarch64') | ternary('s
## Nova ironic console
# Set the console type. Presently the only options are ["serialconsole", "disabled"].
nova_ironic_console_type: "disabled"
nova_ironic_used: "{{ _nova_ironic_used }}"
# Nova console ssl info, presently only used by novnc console type
nova_console_ssl_dir: "/etc/nova/ssl"

View File

@ -20,7 +20,7 @@
# This needs to be done after Compute hosts are added.
- name: Perform a cell_v2 discover
command: "{{ _db_nova_bin }}/nova-manage cell_v2 discover_hosts{{ (debug | bool) | ternary(' --verbose', '') }}{{ (nova_virt_type == 'ironic') | ternary(' --by-service', '') }}"
command: "{{ _db_nova_bin }}/nova-manage cell_v2 discover_hosts{{ (debug | bool) | ternary(' --verbose', '') }}{{ (nova_ironic_used | bool) | ternary(' --by-service', '') }}"
become: yes
become_user: "{{ _db_nova_system_user_name }}"
changed_when: false

View File

@ -15,6 +15,15 @@
_nova_is_first_play_host: "{{ (nova_services['nova-conductor']['group'] in group_names and inventory_hostname == (groups[nova_services['nova-conductor']['group']] | intersect(ansible_play_hosts)) | first) | bool }}"
_nova_ironic_used: |-
{% set _virt_types = [] %}
{% for hv in groups[nova_services['nova-compute']['group']] %}
{% if 'nova_virt_type' in hostvars[hv] %}
{% set _ = _virt_types.append(hostvars[hv]['nova_virt_type']) %}
{% endif %}
{% endfor %}
{{ ('ironic' in _virt_types | unique) }}
nova_venv_packages: |-
{%- set pkg_list = nova_pip_packages | union(nova_user_pip_packages) %}
{%- if nova_oslomsg_amqp1_enabled | bool %}