ip_forward: create role + playbook
This commit is contained in:
parent
66a015c135
commit
9c41558d62
4 changed files with 31 additions and 0 deletions
8
playbooks/ip_forward.yml
Executable file
8
playbooks/ip_forward.yml
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env ansible-playbook
|
||||
---
|
||||
- hosts:
|
||||
- edge-1.rtr.infra.auro.re
|
||||
- edge-2.rtr.infra.auro.re
|
||||
roles:
|
||||
- ip_forward
|
||||
...
|
4
roles/ip_forward/handlers/main.yml
Normal file
4
roles/ip_forward/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- name: Reload sysctl
|
||||
command: sysctl --system
|
||||
...
|
11
roles/ip_forward/tasks/main.yml
Normal file
11
roles/ip_forward/tasks/main.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- name: Enable forwarding
|
||||
template:
|
||||
src: 10-forward.conf.j2
|
||||
dest: /etc/sysctl.d/10-forward.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=rw,g=r,o=r
|
||||
notify:
|
||||
- Reload sysctl
|
||||
...
|
8
roles/ip_forward/templates/10-forward.conf.j2
Normal file
8
roles/ip_forward/templates/10-forward.conf.j2
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{ ansible_managed | comment }}
|
||||
|
||||
# Enable IPv4 forwarding
|
||||
net.ipv4.ip_forward=1
|
||||
net.ipv4.conf.all.forwarding=1
|
||||
|
||||
# Enable IPv6 forwarding
|
||||
net.ipv6.conf.all.forwarding=1
|
Loading…
Reference in a new issue