init
This commit is contained in:
16
update-gateway.yaml
Normal file
16
update-gateway.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
- name: Update default route
|
||||
hosts: all
|
||||
become: yes
|
||||
user: root
|
||||
vars_prompt:
|
||||
- name: "gateway_ip"
|
||||
prompt: "Enter the gateway IP address"
|
||||
private: no
|
||||
|
||||
tasks:
|
||||
- name: Delete the default route
|
||||
command: ip route delete default
|
||||
ignore_errors: yes # Ignore errors in case the default route does not exist
|
||||
|
||||
- name: Add the new default route
|
||||
command: ip route add default via {{ gateway_ip }}
|
||||
Reference in New Issue
Block a user