Ingen beskrivning
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ufw.yml 796B

123456789101112131415161718192021222324252627282930313233343536373839
  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. - https
  23. - ssh
  24. tags: ufw
  25. - name: Enable UFW
  26. ufw: state=enabled
  27. tags: ufw
  28. - name: Check config of ufw
  29. command: cat /etc/ufw/ufw.conf
  30. register: ufw_config
  31. changed_when: False # never report as "changed"
  32. tags: ufw