ip_forward: create role + playbook

This commit is contained in:
jeltz 2023-03-27 11:56:17 +02:00
parent 66a015c135
commit 9c41558d62
Signed by: jeltz
GPG key ID: 800882B66C0C3326
4 changed files with 31 additions and 0 deletions

8
playbooks/ip_forward.yml Executable file
View 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
...

View file

@ -0,0 +1,4 @@
---
- name: Reload sysctl
command: sysctl --system
...

View 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
...

View 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