kayobe/ansible/external-net.yml
Mark Goddard 2de3a2c578 Switch from shade to openstacksdk
Upstream Ansible OpenStack modules now use openstacksdk rather than shade.
Switch local Ansible modules to follow suit. Also switch to use the
stackhpc.os_openstacksdk role from stackhpc.os-shade.

The stackhpc.os-shade role is removed during 'kayobe control host upgrade'.

Change-Id: Id3894c3c36ef99f00ed463de6a3457e11733d6b7
Story: 2007294
Task: 38759
2020-02-20 15:28:56 +00:00

27 lines
1.2 KiB
YAML

---
- name: Ensure external network and subnet are registered in neutron
# Only required to run on a single host.
hosts: controllers[0]
roles:
- role: stackhpc.os-networks
os_openstacksdk_install_epel: "{{ yum_install_epel }}"
os_openstacksdk_state: latest
os_openstacksdk_upper_constraints_file: "{{ pip_upper_constraints_file }}"
os_networks_venv: "{{ virtualenv_path }}/openstacksdk"
os_networks_openstack_auth_type: "{{ openstack_auth_type }}"
os_networks_openstack_auth: "{{ openstack_auth }}"
# Network configuration.
os_networks_name: "{{ item }}"
os_networks_type: "{% if item | net_vlan %}vlan{% else %}flat{% endif %}"
os_networks_physical_network: "physnet1"
os_networks_segmentation_id: "{{ item | net_vlan }}"
os_networks_shared: True
os_networks_external: True
# Subnet configuration.
os_networks_subnet_name: "{{ item }}"
os_networks_cidr: "{{ item | net_cidr }}"
os_networks_gateway_ip: "{{ item | net_gateway }}"
os_networks_allocation_pool_start: "{{ item | net_neutron_allocation_pool_start }}"
os_networks_allocation_pool_end: "{{ item | net_neutron_allocation_pool_end }}"
with_items: "{{ external_net_names }}"