firewall_settings.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Install firewalld
  16. package:
  17. name: firewalld
  18. state: present
  19. - name: Start and enable firewalld
  20. service:
  21. name: firewalld
  22. state: started
  23. enabled: yes
  24. - name: Firewall ports addition - tcp/udp ports
  25. firewalld:
  26. zone: public
  27. port: "{{ item }}"
  28. permanent: true
  29. state: enabled
  30. with_items:
  31. - "{{ https_port1 }}"
  32. - "{{ https_port2 }}"
  33. - "{{ ldap_port1 }}"
  34. - "{{ ldap_port2 }}"
  35. - "{{ kerberos_port1 }}"
  36. - "{{ kerberos_port2 }}"
  37. - "{{ kerberos_port3 }}"
  38. - "{{ kerberos_port4 }}"
  39. - "{{ dns_port1 }}"
  40. - "{{ dns_port2 }}"
  41. - "{{ ntp_port1 }}"
  42. - "{{ dt_port1 }}"
  43. - name: Reload firewalld
  44. command: firewall-cmd --reload
  45. changed_when: true
  46. - name: Stop and disable firewalld
  47. service:
  48. name: firewalld
  49. state: stopped
  50. enabled: no