kayobe/ansible/external-net.yml
Michal Nasiadka 65587cb279 Bump up Ansible supported versions to 5.x/6.x
This change bumps up the maximum supported Ansible version to 6.x
(ansible-core 2.13.x) and minimum to 5.x. This synchronises Kayobe with
Kolla Ansible.

Shebang has been removed from modules due to [1].

os_openstacksdk_version has been added as openstack cloud modules don't
support versions greater than 0.99.

[1]: https://github.com/ansible/ansible/pull/76677

Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/867546
Change-Id: Ibb00f6d079442a8509411ae8a71d74fd7bd8cccd
2022-12-14 14:55:33 +00:00

26 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: "{{ dnf_install_epel }}"
os_openstacksdk_upper_constraints_file: "{{ openstacksdk_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 }}"