Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Commit 6ef7304

Browse files
authored
Merge pull request #10 from dpengla/GATEWAY_DEV
For mutlti-interfaced hosts, the default gateway is based on the
2 parents 0791a14 + 49d371f commit 6ef7304

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tasks/redhat.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,11 @@
2424
template: src=route_{{ ansible_os_family }}.j2 dest={{ net_path }}/route-{{ item.device }}
2525
with_items: "{{ network_bridge_interfaces }}"
2626
when: network_bridge_interfaces is defined and item.route is defined
27+
28+
- name: Cleanup gateway dev that does not set to the one we want
29+
lineinfile: dest=/etc/sysconfig/network regexp="^GATEWAYDEV=(?!{{ gateway_dev }})" state=absent
30+
when: gateway_dev is defined
31+
32+
- name: Explicitly set gateway dev
33+
lineinfile: dest=/etc/sysconfig/network line="GATEWAYDEV={{ gateway_dev }}"
34+
when: gateway_dev is defined

0 commit comments

Comments
 (0)