Loading handlers/main.yaml +1 −6 Original line number Diff line number Diff line --- # restart iptables - name: "restart iptables" ansible.builtin.service: name: "iptables" state: "restarted" when: "ipv4_enabled" - name: "restart ip6tables" ansible.builtin.service: name: "ip6tables" state: "restarted" when: "ipv6_enabled" tasks/main.yaml +3 −0 Original line number Diff line number Diff line --- # routing - name: "routing" ansible.builtin.import_tasks: "routing.yaml" tags: - "all" - "routing" # firewall - name: "firewall" ansible.builtin.import_tasks: "firewall.yaml" tags: - "all" - "firewall" # performance - name: "performance" ansible.builtin.import_tasks: "performance.yaml" tags: Loading tasks/routing.yaml +3 −0 Original line number Diff line number Diff line --- # install iptables - name: "install iptables" community.general.apk: name: Loading @@ -7,6 +8,7 @@ state: "present" update_cache: true # enable ipv4 forwarding - name: "configure ipv4 forwarding" ansible.posix.sysctl: name: "net.ipv4.conf.all.forwarding" Loading @@ -15,6 +17,7 @@ sysctl_file: "/etc/sysctl.conf" reload: false # disable ipv4 redirects and source routing - name: "disable ipv4 redirects and source routing" ansible.posix.sysctl: name: "{{ item.name }}" Loading Loading
handlers/main.yaml +1 −6 Original line number Diff line number Diff line --- # restart iptables - name: "restart iptables" ansible.builtin.service: name: "iptables" state: "restarted" when: "ipv4_enabled" - name: "restart ip6tables" ansible.builtin.service: name: "ip6tables" state: "restarted" when: "ipv6_enabled"
tasks/main.yaml +3 −0 Original line number Diff line number Diff line --- # routing - name: "routing" ansible.builtin.import_tasks: "routing.yaml" tags: - "all" - "routing" # firewall - name: "firewall" ansible.builtin.import_tasks: "firewall.yaml" tags: - "all" - "firewall" # performance - name: "performance" ansible.builtin.import_tasks: "performance.yaml" tags: Loading
tasks/routing.yaml +3 −0 Original line number Diff line number Diff line --- # install iptables - name: "install iptables" community.general.apk: name: Loading @@ -7,6 +8,7 @@ state: "present" update_cache: true # enable ipv4 forwarding - name: "configure ipv4 forwarding" ansible.posix.sysctl: name: "net.ipv4.conf.all.forwarding" Loading @@ -15,6 +17,7 @@ sysctl_file: "/etc/sysctl.conf" reload: false # disable ipv4 redirects and source routing - name: "disable ipv4 redirects and source routing" ansible.posix.sysctl: name: "{{ item.name }}" Loading