Skip to content

Commit c91cfae

Browse files
authored
Remove default route for ironic-boot device on control nodes (#2637)
The subnet has an external gateway for connectivity of instances deployed in it. The resulting default route received via DHCP on control nodes breaks their external connectivity and is therefore removed by a `dhclient` hook. Signed-off-by: Jan Horstmann <[email protected]>
1 parent c733860 commit c91cfae

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

environments/custom/playbook-baremetal-bootstrap.yml

+17
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,23 @@
126126
mode: 0664
127127
notify: Restart ironic-interface.service
128128

129+
# NOTE: The subnet has a default gateway which is used for all nodes deployed in it
130+
# It may break connectivity on control nodes though and is therefore removed
131+
- name: Create ironic dhclient hook
132+
become: true
133+
ansible.builtin.copy:
134+
content: |
135+
#!/bin/bash
136+
if [ "${interface}" = "{{ ironic_network_interface }}" ]; then
137+
case "${reason}" in BOUND|RENEW|REBIND|REBOOT)
138+
ip route delete default via {{ public_subnet.subnet.gateway_ip }} dev {{ ironic_network_interface }}
139+
;;
140+
esac
141+
fi
142+
dest: /etc/dhcp/dhclient-exit-hooks.d/ironic-boot-delete-default-route
143+
mode: 0755
144+
notify: Restart ironic-interface.service
145+
129146
- name: Create ironic-interface service
130147
become: True
131148
ansible.builtin.template:

0 commit comments

Comments
 (0)