説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ufw.yml 846B

12345678910111213141516171819202122232425262728293031
  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. - name: Deny everything and enable UFW
  7. ufw: state=enabled policy=deny
  8. - name: Set firewall rule for DNS
  9. ufw: rule=allow port=domain
  10. - name: Set firewall rule for mosh
  11. ufw: rule=allow port=60000:61000 proto=udp
  12. - name: Set firewall rules for web traffic and SSH
  13. ufw: rule=allow port={{ item }} proto=tcp
  14. with_items:
  15. - http
  16. - https
  17. - ssh
  18. - name: Check config of ufw
  19. command: cat /etc/ufw/ufw.conf
  20. register: ufw_config
  21. changed_when: False # never report as "changed"
  22. - name: Disable logging (workaround for known bug in Debian 7)
  23. ufw: logging=off
  24. when: "ansible_lsb['codename'] == 'wheezy' and 'LOGLEVEL=off' not in ufw_config.stdout"