Update update-default-route.yml
This commit is contained in:
@@ -3,15 +3,9 @@
|
|||||||
hosts: proxmox_nodes
|
hosts: proxmox_nodes
|
||||||
become: true
|
become: true
|
||||||
vars:
|
vars:
|
||||||
new_gateway: "{{ gateway_ip }}"
|
new_gateway: "192.168.1.254"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Validate gateway format
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- new_gateway is match("^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$")
|
|
||||||
fail_msg: "Invalid IPv4 address provided."
|
|
||||||
|
|
||||||
- name: Replace gateway line in interfaces file
|
- name: Replace gateway line in interfaces file
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/network/interfaces
|
path: /etc/network/interfaces
|
||||||
|
|||||||
Reference in New Issue
Block a user