Ironic fixes from inspector addition

1. There was an issue with pip packages not being installed when
inspector_hosts is not defined.

2. The db_setup task failed when inspector_hosts not defined because of
the condition.

Change-Id: I0ccd782ffd54322896559e5a6218ff532f3cae03
This commit is contained in:
Cameron Loader 2020-02-19 10:53:52 -06:00
parent 11f32d2364
commit 1f434661b1
4 changed files with 18 additions and 4 deletions

View File

@ -184,7 +184,6 @@ ironic_tftp_server_address: "{{ ansible_host }}"
ironic_pip_packages: ironic_pip_packages:
- cryptography - cryptography
- ironic - ironic
- "{{ (ironic_services['ironic-inspector']['group'] in group_names) | ternary('ironic-inspector', '') }}"
- osprofiler - osprofiler
- proliantutils - proliantutils
- PyMySQL - PyMySQL
@ -192,7 +191,6 @@ ironic_pip_packages:
- python-dracclient - python-dracclient
- python-ilorest-library - python-ilorest-library
- python-ironicclient - python-ironicclient
- python-ironic-inspector-client
- python-memcached - python-memcached
- python-scciclient - python-scciclient
- python-swiftclient - python-swiftclient
@ -200,6 +198,10 @@ ironic_pip_packages:
- sushy - sushy
- systemd-python - systemd-python
ironic_inspector_pip_packages:
- ironic-inspector
- python-ironic-inspector-client
## Oslo Messaging Info ## Oslo Messaging Info
# RPC # RPC
ironic_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group | default('rabbitmq_all') }}" ironic_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group | default('rabbitmq_all') }}"

View File

@ -26,6 +26,8 @@
command: "{{ ironic_bin }}/ironic-inspector-dbsync --config-file /etc/ironic-inspector/ironic-inspector.conf upgrade" command: "{{ ironic_bin }}/ironic-inspector-dbsync --config-file /etc/ironic-inspector/ironic-inspector.conf upgrade"
become: yes become: yes
changed_when: false changed_when: false
when: "'ironic_inspector' in groups and inventory_hostname == groups['ironic_inspector'][0]" when:
- ironic_services['ironic-inspector']['group'] in group_names
- inventory_hostname == groups[ironic_services['ironic-inspector']['group']][0]
notify: notify:
- Restart ironic services - Restart ironic services

View File

@ -87,7 +87,7 @@
venv_install_destination_path: "{{ ironic_bin | dirname }}" venv_install_destination_path: "{{ ironic_bin | dirname }}"
venv_install_distro_package_list: "{{ ironic_packages_list }}" venv_install_distro_package_list: "{{ ironic_packages_list }}"
venv_pip_install_args: "{{ ironic_pip_install_args }}" venv_pip_install_args: "{{ ironic_pip_install_args }}"
venv_pip_packages: "{{ (ironic_oslomsg_amqp1_enabled | bool) | ternary(ironic_pip_packages + ironic_optional_oslomsg_amqp1_pip_packages, ironic_pip_packages) }}" venv_pip_packages: "{{ ironic_venv_packages }}"
venv_facts_when_changed: venv_facts_when_changed:
- section: "ironic" - section: "ironic"
option: "venv_tag" option: "venv_tag"

View File

@ -318,3 +318,13 @@ filtered_ironic_drivers: |-
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{{ concat_drivers }} {{ concat_drivers }}
ironic_venv_packages: |-
{%- set pkg_list = ironic_pip_packages %}
{%- if (ironic_oslomsg_amqp1_enabled | bool) %}
{%- set _ = pkg_list.extend(ironic_optional_oslomsg_amqp1_pip_packages) %}
{%- endif %}
{%- if (ironic_services['ironic-inspector']['group'] in group_names) %}
{%- set _ = pkg_list.extend(ironic_inspector_pip_packages) %}
{%- endif %}
{{- pkg_list | unique }}