diff --git a/defaults/main.yml b/defaults/main.yml index aaf6a065..2dce7f3f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -311,6 +311,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 proxies # Set the console proxy types. diff --git a/tasks/nova_db_post_setup.yml b/tasks/nova_db_post_setup.yml index 097c49d1..b3ccd16a 100644 --- a/tasks/nova_db_post_setup.yml +++ b/tasks/nova_db_post_setup.yml @@ -22,7 +22,7 @@ - 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', '') }} + (nova_ironic_used | bool) | ternary(' --by-service', '') }} become: yes become_user: "{{ _db_nova_system_user_name }}" changed_when: false diff --git a/vars/main.yml b/vars/main.yml index 196923bd..39847682 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -33,6 +33,15 @@ _nova_oslomsg_notify_vhost_conf: >- ) }} +_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 %}