diff --git a/hooks/playbooks/adoption_ironic_post_oc.yml b/hooks/playbooks/adoption_ironic_post_oc.yml index a97d4164a9..9bea215291 100644 --- a/hooks/playbooks/adoption_ironic_post_oc.yml +++ b/hooks/playbooks/adoption_ironic_post_oc.yml @@ -21,6 +21,7 @@ _subnet_gateway: '172.20.1.1' _subnet_alloc_pool_start: '172.20.1.150' _subnet_alloc_pool_end: '172.20.1.199' + _subnet_ip_version: 4 _provider_physical_network: ironic _provider_network_type: flat tasks: @@ -156,6 +157,14 @@ --gateway {{ _subnet_gateway }} \ --allocation-pool start={{ _subnet_alloc_pool_start }},end={{ _subnet_alloc_pool_end }} + - name: Create router and attach subnet for IPv6 provisioning network + ansible.builtin.shell: + cmd: >- + openstack router show provisioning &>/dev/null || \ + (openstack router create provisioning && \ + openstack router add subnet provisioning provisioning-subnet) + when: _subnet_ip_version | int == 6 + - name: Slurp ironic_nodes.yaml from controller-0 delegate_to: controller-0 register: _ironic_nodes_slurp diff --git a/hooks/playbooks/ironic_network.yml b/hooks/playbooks/ironic_network.yml index 2097423b52..3e00483b3a 100644 --- a/hooks/playbooks/ironic_network.yml +++ b/hooks/playbooks/ironic_network.yml @@ -47,3 +47,13 @@ --gateway {{ _subnet_gateway }} \ --dns-nameserver {{ _subnet_nameserver }} \ --allocation-pool start={{ _subnet_alloc_pool_start }},end={{ _subnet_alloc_pool_end }} + + - name: Create router for IPv6 provisioning network + ansible.builtin.shell: | + set -xe -o pipefail + oc project {{ _namespace }} + oc rsh openstackclient \ + openstack router create provisioning + oc rsh openstackclient \ + openstack router add subnet provisioning provisioning-subnet + when: _subnet_ip_version | int == 6