Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions roles/firewall/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@
- Restart dnsmasq
tags: dnsmasq

- name: Enable IP forwarding
ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_set: true
state: present
reload: true
- name: Enable IP fwd
ansible.builtin.command:
cmd: echo 1 > /proc/sys/net/ipv4/ip_forward
changed_when: firewall_command_result.rc == 0
register: firewall_command_result

- name: Enable IP fwd permanently
ansible.builtin.lineinfile:
path: /etc/sysctl.d/ip_forward.conf
line: net.ipv4.ip_forward=1
owner: root
group: root
mode: '0655'
create: true

- name: Template nftables FW rules
ansible.builtin.template:
Expand Down
21 changes: 14 additions & 7 deletions roles/single_nic_firewall/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,20 @@
- Restart dnsmasq
tags: dnsmasq

- name: Enable IP forwarding
ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_set: true
state: present
reload: true
- name: Enable IP fwd
ansible.builtin.command:
cmd: echo 1 > /proc/sys/net/ipv4/ip_forward
changed_when: single_nic_firewall_command_result.rc == 0
register: single_nic_firewall_command_result

- name: Enable IP fwd permanently
ansible.builtin.lineinfile:
path: /etc/sysctl.d/ip_forward.conf
line: net.ipv4.ip_forward=1
owner: root
group: root
mode: '0655'
create: true

- name: Template nftables FW rules
ansible.builtin.template:
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.