Explorar o código

Update check_prerequisites.yml

Signed-off-by: abhishek-sa1 <abhishek.sa3@dell.com>
abhishek-sa1 %!s(int64=3) %!d(string=hai) anos
pai
achega
9493d0ee9a

+ 25 - 6
control_plane/roles/control_plane_customiso/tasks/check_prerequisites.yml

@@ -13,9 +13,17 @@
 # limitations under the License.
 ---
 
+- name: Include control_plane_common vars
+  include_vars: ../../control_plane_common/vars/main.yml
+  tags: install
+
+- name: Include provision_cobbler vars
+  include_vars: ../../provision_cobbler/vars/main.yml
+  tags: install
+
 - name: Install xorriso package - rocky
   package:
-    name: xorriso
+    name: "{{ iso_package }}"
     state: present
   tags: install
   when:
@@ -24,7 +32,7 @@
 
 - name: Install xorriso package - leap
   zypper:
-    name: xorriso
+    name: "{{ iso_package }}"
     state: present
   tags: install
   when: os_supported_leap in ansible_distribution | lower
@@ -33,9 +41,7 @@
   command: ansible-galaxy collection install {{ item }}
   changed_when: true
   tags: install
-  with_items:
-   - community.general
-   - dellemc.openmanage
+  with_items: "{{ idrac_collections }}"
 
 - name: Install omsdk using pip
   pip:
@@ -49,10 +55,23 @@
   register: check_mount_iso
   tags: install
 
+- name: Include provision_cobbler vars
+  include_tasks: ../../provision_cobbler/tasks/mount_iso.yml
+  when: not check_mount_iso.stat.exists
+
+- name: Recheck iso mount folder
+  stat:
+    path: "{{ iso_mount_path }}{{ grub_cfg_path }}"
+  register: recheck_mount_iso
+  when: not check_mount_iso.stat.exists
+  tags: install
+
 - name: Incorrect iso mount
   fail:
     msg: "{{ iso_mount_check_fail_msg }}"
-  when: not check_mount_iso.stat.exists
+  when:
+    - not check_mount_iso.stat.exists
+    - not recheck_mount_iso.stat.exists
   register: iso_mount_fail
   tags: install