pre_requisite.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. changed_when: false
  40. - name: Disable SElinux
  41. replace:
  42. path: /etc/sysconfig/selinux
  43. regexp: 'SELINUX=[a-z]+'
  44. replace: 'SELINUX=disabled'
  45. when: '"SELinux status: enabled" in sestatus_current.stdout_lines'
  46. tags: install
  47. - name: Status of SElinux
  48. fail:
  49. msg: "{{ selinux_status }}"
  50. when: '"SELinux status: enabled" in sestatus_current.stdout_lines'
  51. register: selinux_value
  52. tags: install
  53. - name: State of firewall
  54. service:
  55. name: firewalld
  56. state: started
  57. enabled: yes