Skip to content

Commit 35b8986

Browse files
committed
ironic hooks: Add a router if IPv6
For IPv6 network booting to work we need a router that does router advertisements with the options to instrcut clients to attempt DHCPv6 Config requests. This change adds a tasks to both adoption_ironic_post_oc and ironic_network hooks which create this router. Jira: OSPRH-20084 Jira: OSPRH-20019
1 parent 61c908b commit 35b8986

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

hooks/playbooks/adoption_ironic_post_oc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
_subnet_gateway: '172.20.1.1'
2222
_subnet_alloc_pool_start: '172.20.1.150'
2323
_subnet_alloc_pool_end: '172.20.1.199'
24+
_subnet_ip_version: 4
2425
_provider_physical_network: ironic
2526
_provider_network_type: flat
2627
tasks:
@@ -156,6 +157,14 @@
156157
--gateway {{ _subnet_gateway }} \
157158
--allocation-pool start={{ _subnet_alloc_pool_start }},end={{ _subnet_alloc_pool_end }}
158159
160+
- name: Create router and attach subnet for IPv6 provisioning network
161+
ansible.builtin.shell:
162+
cmd: >-
163+
openstack router show provisioning &>/dev/null || \
164+
(openstack router create provisioning && \
165+
openstack router add subnet provisioning provisioning-subnet)
166+
when: _subnet_ip_version | int == 6
167+
159168
- name: Slurp ironic_nodes.yaml from controller-0
160169
delegate_to: controller-0
161170
register: _ironic_nodes_slurp

hooks/playbooks/ironic_network.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,13 @@
4747
--gateway {{ _subnet_gateway }} \
4848
--dns-nameserver {{ _subnet_nameserver }} \
4949
--allocation-pool start={{ _subnet_alloc_pool_start }},end={{ _subnet_alloc_pool_end }}
50+
51+
- name: Create router for IPv6 provisioning network
52+
ansible.builtin.shell: |
53+
set -xe -o pipefail
54+
oc project {{ _namespace }}
55+
oc rsh openstackclient \
56+
openstack router create provisioning
57+
oc rsh openstackclient \
58+
openstack router add subnet provisioning provisioning-subnet
59+
when: _subnet_ip_version | int == 6

0 commit comments

Comments
 (0)