Merge "Support ocata release of ironic"

This commit is contained in:
Zuul 2018-12-20 15:40:13 +00:00 committed by Gerrit Code Review
commit aeeea7d442
2 changed files with 20 additions and 4 deletions

View File

@ -26,6 +26,20 @@
until: result is success
retries: 3
- name: Detect ironic API version
command: >-
{{ ironic_virtualenv_path }}/bin/openstack
--os-baremetal-api-version 1.34
baremetal node list
register: api_version_result
changed_when: false
failed_when: false
# This is used in port.yml.
- name: Set a fact about whether Ironic supports physical network awareness
set_fact:
supports_port_physnet: "{{ api_version_result.rc == 0 }}"
# This command will return the UUIDs, regardless of whether
# ironic_deploy_kernel and ironic_deploy_ramdisk are image UUIDs or names.
- name: Get OpenStack deployment image UUIDs

View File

@ -40,12 +40,14 @@
command: >-
'{{ ironic_virtualenv_path }}/bin/openstack' baremetal port set
{{ uuid.stdout }}
{% if supports_port_physnet %}
--physical-network '{{ physnet }}'
{% endif %}
--local-link-connection switch_id='{{ switch_id }}'
--local-link-connection switch_info='{{ bridge }}'
--local-link-connection port_id='{{ port_id }}'
when: >-
port_attributes.physical_network != physnet or
port_attributes.local_link_connection.switch_id != switch_id or
port_attributes.local_link_connection.switch_info != switch_info or
port_attributes.local_link_connection.port_id != port_id
(supports_port_physnet and port_attributes.physical_network != physnet) or
port_attributes.local_link_connection.get('switch_id') != switch_id or
port_attributes.local_link_connection.get('switch_info') != switch_info or
port_attributes.local_link_connection.get('port_id') != port_id