firewall.yml 817 B

12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. # TODO: Ansible 1.9 will eliminate the need for separate firewalld tasks for
  3. # enabling rules and making them permanent with the immediate flag
  4. - name: "Add firewalld allow rules"
  5. firewalld:
  6. port: "{{ item.port }}"
  7. permanent: false
  8. state: enabled
  9. with_items: allow
  10. when: allow is defined
  11. - name: "Persist firewalld allow rules"
  12. firewalld:
  13. port: "{{ item.port }}"
  14. permanent: true
  15. state: enabled
  16. with_items: allow
  17. when: allow is defined
  18. - name: "Remove firewalld allow rules"
  19. firewalld:
  20. port: "{{ item.port }}"
  21. permanent: false
  22. state: disabled
  23. with_items: deny
  24. when: deny is defined
  25. - name: "Persist removal of firewalld allow rules"
  26. firewalld:
  27. port: "{{ item.port }}"
  28. permanent: true
  29. state: disabled
  30. with_items: deny
  31. when: deny is defined