role_ipforwarding/tasks/main.yml

21 lines
586 B
YAML
Raw Normal View History

2023-04-18 15:35:39 +00:00
---
# tasks file for ipforwarding
- name: Changer pour IPv4
ansible.posix.sysctl:
name: net.ipv4.conf.all.forwarding
value: "{{ ipforwarding_ipv4 | string }}"
sysctl_file: /etc/sysctl.d/100-ipv4_forwarding.conf
sysctl_set: true
become: true
when: ipforwarding_ipv4 | string | length > 0
- name: Changer pour IPv6
ansible.posix.sysctl:
name: net.ipv6.conf.all.forwarding
value: "{{ ipforwarding_ipv6 | string }}"
sysctl_file: /etc/sysctl.d/100-ipv6_forwarding.conf
sysctl_set: true
become: true
when: ipforwarding_ipv6 | string | length > 0