create_unattended_iso.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright 2021 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: Create custom ISO
  16. command: >-
  17. mkisofs -o /tmp/{{ unattended_iso_filename }} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4
  18. -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -J -R -V "CentOS 7 x86_64" {{ tmp_iso_dir }}
  19. changed_when: true
  20. register: custom_iso_status
  21. tags: install
  22. args:
  23. chdir: "{{ tmp_iso_dir }}"
  24. - name: Custom ISO creation status check
  25. assert:
  26. that:
  27. - "'Total directory bytes:' in custom_iso_status.stderr"
  28. - "'Path table size(bytes):' in custom_iso_status.stderr"
  29. - "'Max brk space used' in custom_iso_status.stderr"
  30. - "'extents written' in custom_iso_status.stderr"
  31. success_msg: "{{ custom_iso_success_msg }}"
  32. fail_msg: "{{ custom_iso_fail_msg }}"
  33. register: iso_success_check
  34. - name: Remove the kickstart file
  35. file:
  36. path: "{{ role_path }}/files/{{ kickstart_file }}"
  37. state: absent
  38. tags: install
  39. - name: Include control_plane_common vars
  40. include_vars: ../../control_plane_common/vars/main.yml
  41. - name: Copy ISO file to nfs share
  42. copy:
  43. src: "/tmp/{{ unattended_iso_filename }}"
  44. dest: "{{ nfs_share_offline_repo }}/{{ unattended_iso_filename }}"
  45. mode: preserve
  46. tags: install