iptables.yml 831 B

1234567891011121314151617181920212223242526272829303132333435
  1. ---
  2. - name: Ensure firewalld service is not enabled
  3. systemd:
  4. name: firewalld
  5. state: stopped
  6. enabled: no
  7. masked: yes
  8. register: task_result
  9. failed_when: task_result|failed and 'could not' not in task_result.msg|lower
  10. - name: Wait 10 seconds after disabling firewalld
  11. pause:
  12. seconds: 10
  13. when: task_result | changed
  14. - name: Install iptables packages
  15. package: name={{ item }} state=present
  16. with_items:
  17. - iptables
  18. - iptables-services
  19. when: not openshift.common.is_atomic | bool
  20. - name: Start and enable iptables service
  21. systemd:
  22. name: iptables
  23. state: started
  24. enabled: yes
  25. masked: no
  26. daemon_reload: yes
  27. register: result
  28. - name: need to pause here, otherwise the iptables service starting can sometimes cause ssh to fail
  29. pause: seconds=10
  30. when: result | changed