Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ufw.yml 979B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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
  33. - name: Disable logging (workaround for known bug in Debian 7)
  34. ufw: logging=off
  35. when: "ansible_lsb['codename'] == 'wheezy' and 'LOGLEVEL=off' not in ufw_config.stdout"
  36. tags: ufw