Merge "provision-net: Remove transitional unshare code"
This commit is contained in:
commit
0cb0e9feef
@ -48,7 +48,7 @@
|
|||||||
tags:
|
tags:
|
||||||
- provision-net
|
- provision-net
|
||||||
- cleaning-net
|
- cleaning-net
|
||||||
pre_tasks:
|
tasks:
|
||||||
- name: Validate OpenStack password authentication parameters
|
- name: Validate OpenStack password authentication parameters
|
||||||
fail:
|
fail:
|
||||||
msg: >
|
msg: >
|
||||||
@ -62,69 +62,16 @@
|
|||||||
tags:
|
tags:
|
||||||
- config-validation
|
- config-validation
|
||||||
|
|
||||||
roles:
|
- import_role:
|
||||||
- role: stackhpc.os-networks
|
name: stackhpc.os-networks
|
||||||
os_openstacksdk_install_epel: "{{ dnf_install_epel }}"
|
|
||||||
os_openstacksdk_state: "latest"
|
|
||||||
os_networks_upper_constraints_file: "{{ openstacksdk_upper_constraints_file }}"
|
|
||||||
os_networks_venv: "{{ venv }}"
|
|
||||||
os_networks_auth_type: "{{ openstack_auth_type }}"
|
|
||||||
os_networks_auth: "{{ openstack_auth }}"
|
|
||||||
os_networks_cacert: "{{ openstack_cacert | default(omit, true) }}"
|
|
||||||
os_networks_interface: "{{ openstack_interface | default(omit, true) }}"
|
|
||||||
# Network configuration.
|
|
||||||
os_networks: "{{ network_registrations }}"
|
|
||||||
tasks:
|
|
||||||
# NOTE(mgoddard): Originally, provisioning and cleaning networks were
|
|
||||||
# always shared. However now, VLAN networks are not shared. The os_network
|
|
||||||
# module does not appear to update networks after they have been created,
|
|
||||||
# so during this transition we manually update them here if necessary.
|
|
||||||
# TODO(mgoddard): Remove this code after a suitable transition period.
|
|
||||||
|
|
||||||
- name: Ensure python-openstackclient is installed
|
|
||||||
pip:
|
|
||||||
name: python-openstackclient
|
|
||||||
state: latest
|
|
||||||
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}"
|
|
||||||
virtualenv: "{{ venv }}"
|
|
||||||
when: network_registrations | rejectattr('shared') | list | length > 0
|
|
||||||
|
|
||||||
- block:
|
|
||||||
- name: Gather facts about provisioning network
|
|
||||||
os_networks_info:
|
|
||||||
auth: "{{ openstack_auth }}"
|
|
||||||
auth_type: "{{ openstack_auth_type }}"
|
|
||||||
cacert: "{{ openstack_cacert | default(omit, true) }}"
|
|
||||||
interface: "{{ openstack_interface | default(omit, true) }}"
|
|
||||||
name: "{{ provision_net.name }}"
|
|
||||||
register: provisioning_network_facts
|
|
||||||
|
|
||||||
- name: Set provisioning network to unshared
|
|
||||||
command: "{{ venv }}/bin/openstack network set {{ provision_net.name }} --no-share"
|
|
||||||
changed_when: true
|
|
||||||
when: provisioning_network_facts.openstack_networks[0].shared
|
|
||||||
environment: "{{ openstack_auth_env }}"
|
|
||||||
vars:
|
vars:
|
||||||
ansible_python_interpreter: "{{ venv }}/bin/python"
|
os_openstacksdk_install_epel: "{{ dnf_install_epel }}"
|
||||||
when: not provision_net.shared | bool
|
os_openstacksdk_state: "latest"
|
||||||
|
os_networks_upper_constraints_file: "{{ openstacksdk_upper_constraints_file }}"
|
||||||
- block:
|
os_networks_venv: "{{ venv }}"
|
||||||
- name: Gather facts about cleaning network
|
os_networks_auth_type: "{{ openstack_auth_type }}"
|
||||||
os_networks_info:
|
os_networks_auth: "{{ openstack_auth }}"
|
||||||
auth: "{{ openstack_auth }}"
|
os_networks_cacert: "{{ openstack_cacert | default(omit, true) }}"
|
||||||
auth_type: "{{ openstack_auth_type }}"
|
os_networks_interface: "{{ openstack_interface | default(omit, true) }}"
|
||||||
cacert: "{{ openstack_cacert | default(omit, true) }}"
|
# Network configuration.
|
||||||
interface: "{{ openstack_interface | default(omit, true) }}"
|
os_networks: "{{ network_registrations }}"
|
||||||
name: "{{ cleaning_net.name }}"
|
|
||||||
register: cleaning_network_facts
|
|
||||||
|
|
||||||
- name: Set cleaning network to unshared
|
|
||||||
command: "{{ venv }}/bin/openstack network set {{ cleaning_net.name }} --no-share"
|
|
||||||
changed_when: true
|
|
||||||
when: cleaning_network_facts.openstack_networks[0].shared
|
|
||||||
environment: "{{ openstack_auth_env }}"
|
|
||||||
vars:
|
|
||||||
ansible_python_interpreter: "{{ venv }}/bin/python"
|
|
||||||
when:
|
|
||||||
- cleaning_net_name != provision_wl_net_name
|
|
||||||
- not cleaning_net.shared | bool
|
|
||||||
|
Loading…
Reference in New Issue
Block a user