pre_requisite.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. tags: install
  30. - name: Check OS support
  31. fail:
  32. msg: "{{ os_status }}"
  33. when: not(ansible_distribution == os_name and ansible_distribution_version >= os_version)
  34. register: os_value
  35. tags: install
  36. - name: Fetch SElinux mode
  37. command: sestatus
  38. register: sestatus_current
  39. - name: Disable SElinux
  40. replace:
  41. path: /etc/sysconfig/selinux
  42. regexp: 'SELINUX=[a-z]+'
  43. replace: 'SELINUX=disabled'
  44. when: '"SELinux status: enabled" in sestatus_current.stdout_lines'
  45. tags: install
  46. - name: Status of SElinux
  47. fail:
  48. msg: "{{ selinux_status }}"
  49. when: '"SELinux status: enabled" in sestatus_current.stdout_lines'
  50. register: selinux_value
  51. tags: install
  52. - name: State of firewall
  53. service:
  54. name: firewalld
  55. state: started
  56. enabled: yes