diff --git a/handlers/main.yaml b/handlers/main.yaml index 2b0f573..b753ed3 100644 --- a/handlers/main.yaml +++ b/handlers/main.yaml @@ -1,13 +1,8 @@ --- +# 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" diff --git a/tasks/main.yaml b/tasks/main.yaml index f9ec38a..57178bf 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -1,17 +1,20 @@ --- +# 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: diff --git a/tasks/routing.yaml b/tasks/routing.yaml index f9b772b..43620c2 100644 --- a/tasks/routing.yaml +++ b/tasks/routing.yaml @@ -1,5 +1,6 @@ --- +# install iptables - name: "install iptables" community.general.apk: name: @@ -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" @@ -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 }}"