main.yml 653 B

123456789101112131415161718192021222324
  1. ---
  2. - name: Ensure iptables and iptables-persistent are installed
  3. apt: name={{ item }} install_recommends=no
  4. with_items:
  5. - iptables
  6. - iptables-persistent
  7. notify:
  8. - Restart netfilter-persistent
  9. - name: Configure netfilter-persistent
  10. copy: src=netfilter-persistent.default dest=/etc/default/netfilter-persistent
  11. notify:
  12. - Restart netfilter-persistent
  13. - name: Install IPv6 iptables rules
  14. template: src=rules.v6.j2 dest=/etc/iptables/rules.v6
  15. notify:
  16. - Restart netfilter-persistent
  17. - name: Install IPv4 iptables rules
  18. template: src=rules.v4.j2 dest=/etc/iptables/rules.v4
  19. notify:
  20. - Restart netfilter-persistent