check_prerequisites.yml 2.5 KB

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