Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738
  1. ---
  2. # Installs and configures ufw, which in turn uses iptables for firewall management.
  3. # ufw includes sensible ICMP defaults.
  4. - name: Install ufw
  5. apt: pkg=ufw state=present
  6. tags:
  7. - dependencies
  8. - ufw
  9. - name: Deny everything
  10. ufw: policy=deny
  11. tags: ufw
  12. - name: Set firewall rule for DNS
  13. ufw: rule=allow port=domain
  14. tags: ufw
  15. - name: Set firewall rule for mosh
  16. ufw: rule=allow port=60000:61000 proto=udp
  17. tags: ufw
  18. - name: Set firewall rules for web traffic and SSH
  19. ufw: rule=allow port={{ item }} proto=tcp
  20. with_items:
  21. - http
  22. - ssh
  23. tags: ufw
  24. - name: Enable UFW
  25. ufw: state=enabled
  26. tags: ufw
  27. - name: Check config of ufw
  28. command: cat /etc/ufw/ufw.conf
  29. register: ufw_config
  30. changed_when: False # never report as "changed"
  31. tags: ufw