check_prerequisites.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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: Include control_plane_common vars
  16. include_vars: ../../control_plane_common/vars/main.yml
  17. tags: install
  18. - name: Include provision_cobbler vars
  19. include_vars: ../../provision_cobbler/vars/main.yml
  20. tags: install
  21. - name: Install xorriso package - rocky
  22. package:
  23. name: "{{ iso_package }}"
  24. state: present
  25. tags: install
  26. when:
  27. - ansible_distribution | lower == os_supported_centos or
  28. ansible_distribution | lower == os_supported_rocky
  29. - name: Install xorriso package - leap
  30. zypper:
  31. name: "{{ iso_package }}"
  32. state: present
  33. tags: install
  34. when: os_supported_leap in ansible_distribution | lower
  35. - name: Install ansible-galaxy modules
  36. command: ansible-galaxy collection install {{ item }}
  37. changed_when: true
  38. tags: install
  39. with_items: "{{ idrac_collections }}"
  40. - name: Install omsdk using pip
  41. pip:
  42. name: omsdk
  43. state: present
  44. tags: install
  45. - name: Check iso mount folder
  46. stat:
  47. path: "{{ iso_mount_path }}{{ grub_cfg_path }}"
  48. register: check_mount_iso
  49. tags: install
  50. - name: Include provision_cobbler vars
  51. include_tasks: ../../provision_cobbler/tasks/mount_iso.yml
  52. when: not check_mount_iso.stat.exists
  53. - name: Recheck iso mount folder
  54. stat:
  55. path: "{{ iso_mount_path }}{{ grub_cfg_path }}"
  56. register: recheck_mount_iso
  57. when: not check_mount_iso.stat.exists
  58. tags: install
  59. - name: Incorrect iso mount
  60. fail:
  61. msg: "{{ iso_mount_check_fail_msg }}"
  62. when:
  63. - not check_mount_iso.stat.exists
  64. - not recheck_mount_iso.stat.exists
  65. register: iso_mount_fail
  66. tags: install
  67. - name: Copy management station ip to {{ management_station_ip_file }}
  68. lineinfile:
  69. path: "{{ role_path }}/../provision_idrac/files/{{ management_station_ip_file }}"
  70. line: "{{ mngmnt_network_ip }}"
  71. mode: "{{ file_permission }}"
  72. create: yes
  73. tags: install