소스 검색

Update create_unattended_iso_rocky.yml

Signed-off-by: abhishek-sa1 <abhishek.sa3@dell.com>
abhishek-sa1 3 년 전
부모
커밋
493085cec6
1개의 변경된 파일43개의 추가작업 그리고 0개의 파일을 삭제
  1. 43 0
      control_plane/roles/control_plane_customiso/tasks/create_unattended_iso_rocky.yml

+ 43 - 0
control_plane/roles/control_plane_customiso/tasks/create_unattended_iso_rocky.yml

@@ -1 +1,44 @@
+#  Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+---
 
 
+- name: Fetch rocky profile name
+  shell: set -o pipefail && grep 'Rocky-8' /mnt/rocky/EFI/BOOT/grub.cfg | head -1
+  register: rocky_profile_name
+  changed_when: false
+
+- name: Create custom ISO rocky
+  command: >-
+    xorriso -as mkisofs -o {{ nfs_share_offline_repo }}/{{ rocky_iso_filename }} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4
+    -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -J -R -V {{ rocky_profile_name.stdout.split(' ')[4] | replace("'","") }}  {{ tmp_iso_dir }}
+  changed_when: true
+  register: rocky_iso_status
+  tags: install
+  args:
+    chdir: "{{ tmp_iso_dir }}"
+
+- name: Custom ISO creation status check rocky
+  assert:
+    that:
+      - custom_iso_success_keyword1 in rocky_iso_status.stderr
+      - custom_iso_success_keyword2 in rocky_iso_status.stderr
+    success_msg: "{{ custom_iso_success_msg }}"
+    fail_msg: "{{ custom_iso_fail_msg }}"
+  tags: install
+
+- name: Remove the kickstart file
+  file:
+    path: "{{ role_path }}/files/{{ idrac_kickstart_file }}"
+    state: absent
+  tags: install