feat: add static routes
This commit is contained in:
parent
3b18a8a16f
commit
7939bb1b14
4 changed files with 37 additions and 4 deletions
|
|
@ -5,3 +5,13 @@
|
|||
ansible.builtin.service:
|
||||
name: "iptables"
|
||||
state: "restarted"
|
||||
|
||||
# apply local routes
|
||||
- name: "apply routes"
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
{% for route in static_routes %}
|
||||
ip route replace {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }}
|
||||
{% endfor %}
|
||||
when: "static_routes | length > 0"
|
||||
changed_when: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue