create_unattended_iso.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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: ISO creation - centos
  16. block:
  17. - name: Create custom ISO
  18. command: >-
  19. xorriso -as mkisofs -o {{ nfs_share_offline_repo }}/{{ centos_iso_filename }} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4
  20. -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -J -R -V "CentOS 7 x86_64" {{ tmp_iso_dir }}
  21. changed_when: true
  22. register: centos_iso_status
  23. tags: install
  24. args:
  25. chdir: "{{ tmp_iso_dir }}"
  26. - name: Custom ISO creation status check
  27. assert:
  28. that:
  29. - custom_iso_success_keyword1 in centos_iso_status.stderr
  30. - custom_iso_success_keyword2 in centos_iso_status.stderr
  31. success_msg: "{{ custom_iso_success_msg }}"
  32. fail_msg: "{{ custom_iso_fail_msg }}"
  33. tags: install
  34. when: provision_os == os_supported_centos
  35. - name: ISO creation - rocky
  36. block:
  37. - name: Create custom ISO
  38. command: >-
  39. 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
  40. -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -J -R -V "Rocky-8-4-x86_64-dvd" {{ tmp_iso_dir }}
  41. changed_when: true
  42. register: rocky_iso_status
  43. tags: install
  44. args:
  45. chdir: "{{ tmp_iso_dir }}"
  46. - name: Custom ISO creation status check
  47. assert:
  48. that:
  49. - custom_iso_success_keyword1 in rocky_iso_status.stderr
  50. - custom_iso_success_keyword2 in rocky_iso_status.stderr
  51. success_msg: "{{ custom_iso_success_msg }}"
  52. fail_msg: "{{ custom_iso_fail_msg }}"
  53. tags: install
  54. when: provision_os == os_supported_rocky
  55. - name: ISO creation - leap
  56. block:
  57. - name: Create custom ISO
  58. command: >-
  59. xorriso -as mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 4 -b boot/x86_64/loader/isolinux.bin
  60. -c boot/x86_64/loader/boot.cat -eltorito-alt-boot -e boot/x86_64/efi -no-emul-boot -o {{ nfs_share_offline_repo }}/{{ leap_iso_filename }} {{ tmp_iso_dir }}
  61. changed_when: true
  62. register: leap_iso_status
  63. tags: install
  64. args:
  65. chdir: "{{ tmp_iso_dir }}"
  66. - name: Custom ISO creation status check
  67. assert:
  68. that:
  69. - custom_iso_success_keyword1 in leap_iso_status.stderr
  70. - custom_iso_success_keyword2 in leap_iso_status.stderr
  71. success_msg: "{{ custom_iso_success_msg }}"
  72. fail_msg: "{{ custom_iso_fail_msg }}"
  73. tags: install
  74. when: provision_os == os_supported_leap
  75. - name: Remove the kickstart file
  76. file:
  77. path: "{{ role_path }}/files/{{ idrac_kickstart_file }}"
  78. state: absent
  79. tags: install