Skip to content

Commit 7e5c051

Browse files
committed
fix removing gateways
1 parent a694be3 commit 7e5c051

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ansible/roles/gateway/files/gateway-init.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@
5353

5454
- name: Remove undesired gateways
5555
shell: |
56-
nmcli connection modify '{{ item.connection }}' ipv4.gateway ''
56+
nmcli connection modify '{{ item.connection }}' \
57+
ipv4.never-default yes \
58+
ipv6.never-default yes
5759
nmcli connection up '{{ item.connection }}'
5860
when:
5961
- gateway_ip != ''
6062
- item.ip4_gateway != ''
6163
- item.connection != gateway_ip_connection
6264
loop: "{{ nmcli_devices }}"
6365

64-
- name: Add desired gateways # TESTED OK
66+
- name: Add desired gateways
6567
shell: |
6668
nmcli connection modify '{{ item.connection }}' \
6769
ipv4.address {{ item.ip4_address }} \

0 commit comments

Comments
 (0)