kayobe/ansible/provision-net.yml
Will Szumski 0511f67eb2 Adds configuration option for separate cleaning network
To improve network isolation it is desirable to perform
cleaning on a separate network. A new network, `cleaning_net`
was added. If cleaning_net_name is not overriden cleaning
will still be performed on the workload provisioning network
to maintain backwards compatability.

Story: 2002097
Task: 19775
Change-Id: I7dd246ca830820f9c2468b281f6ac8f0db2e9cbe
2018-06-06 09:11:56 +01:00

67 lines
3.0 KiB
YAML

---
- name: Check whether Ironic is enabled
hosts: controllers
tags:
- provision-net
- cleaning-net
tasks:
- name: Create controllers group with ironic enabled
group_by:
key: "controllers_for_provision_net_{{ kolla_enable_ironic | bool }}"
- name: Ensure provisioning and cleaning networks and subnets are registered in neutron
# Only required to run on a single host.
hosts: controllers_for_provision_net_True[0]
gather_facts: False
vars:
provision_net:
name: "{{ kolla_ironic_provisioning_network }}"
provider_network_type: "{% if provision_wl_net_name | net_vlan %}vlan{% else %}flat{% endif %}"
provider_physical_network: "{{ provision_wl_net_name | net_physical_network | default('physnet1', True) }}"
provider_segmentation_id: "{{ provision_wl_net_name | net_vlan }}"
shared: True
subnets:
- name: "{{ kolla_ironic_provisioning_network }}"
cidr: "{{ provision_wl_net_name | net_cidr }}"
gateway_ip: "{{ provision_wl_net_name | net_neutron_gateway or provision_wl_net_name | net_gateway }}"
allocation_pool_start: "{{ provision_wl_net_name | net_neutron_allocation_pool_start }}"
allocation_pool_end: "{{ provision_wl_net_name | net_neutron_allocation_pool_end }}"
cleaning_net:
name: "{{ kolla_ironic_cleaning_network }}"
provider_network_type: "{% if cleaning_net_name | net_vlan %}vlan{% else %}flat{% endif %}"
provider_physical_network: "{{ cleaning_net_name | net_physical_network | default('physnet1', True) }}"
provider_segmentation_id: "{{ cleaning_net_name | net_vlan }}"
shared: True
subnets:
- name: "{{ kolla_ironic_cleaning_network }}"
cidr: "{{ cleaning_net_name | net_cidr }}"
gateway_ip: "{{ cleaning_net_name | net_neutron_gateway or cleaning_net_name | net_gateway }}"
allocation_pool_start: "{{ cleaning_net_name | net_neutron_allocation_pool_start }}"
allocation_pool_end: "{{ cleaning_net_name | net_neutron_allocation_pool_end }}"
network_registrations:
- "{{ provision_net }}"
tags:
- provision-net
- cleaning-net
pre_tasks:
- name: Validate OpenStack password authentication parameters
fail:
msg: >
Required OpenStack authentication parameter {{ item }} is
{% if item in openstack_auth %}empty{% else %}not present{% endif %}
in openstack_auth. Have you sourced the environment file?
when:
- openstack_auth_type == 'password'
- item not in openstack_auth or not openstack_auth[item]
with_items: "{{ openstack_auth_password_required_params }}"
tags:
- config-validation
roles:
- role: stackhpc.os-networks
os_networks_venv: "{{ virtualenv_path }}/shade"
os_networks_auth_type: "{{ openstack_auth_type }}"
os_networks_auth: "{{ openstack_auth }}"
# Network configuration.
os_networks: "{{ network_registrations + ([] if cleaning_net_name == provision_wl_net_name else [cleaning_net]) }}"