pre_requisite.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright 2020 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: Verify the ansible and python versions installed
  16. fail:
  17. msg: "{{ ansible_python_version_status }}"
  18. when: ansible_python_version != python_version_support
  19. tags: install
  20. - name: Verify whether ansible configuration file exists
  21. stat:
  22. path: "{{ default_ansible_config_file_path }}"
  23. register: file_exists
  24. - name: Set omnia.log file
  25. replace:
  26. path: "{{ default_ansible_config_file_path }}"
  27. regexp: '#log_path = /var/log/ansible.log'
  28. replace: 'log_path = /var/log/omnia.log'
  29. when: file_exists.stat.exists
  30. tags: install
  31. - name: Check OS support
  32. fail:
  33. msg: "{{ os_status }}"
  34. when: not(ansible_distribution == os_name and ansible_distribution_version >= os_version)
  35. register: os_value
  36. tags: install
  37. - name: Fetch SElinux mode
  38. command: sestatus
  39. register: sestatus_current
  40. changed_when: false
  41. - name: Disable SElinux
  42. replace:
  43. path: /etc/sysconfig/selinux
  44. regexp: 'SELINUX=[a-z]+'
  45. replace: 'SELINUX=disabled'
  46. when: '"SELinux status: enabled" in sestatus_current.stdout_lines'
  47. tags: install
  48. - name: Status of SElinux
  49. fail:
  50. msg: "{{ selinux_status }}"
  51. when: '"SELinux status: enabled" in sestatus_current.stdout_lines'
  52. register: selinux_value
  53. tags: install
  54. - name: State of firewall
  55. service:
  56. name: firewalld
  57. state: started
  58. enabled: yes