generate_disks_efi.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ---
  2. - name: Copy netboot.xyz local EFI iPXE configs
  3. ansible.builtin.copy:
  4. src: "ipxe/local/{{ item }}"
  5. dest: "{{ ipxe_source_dir }}/src/config/local/{{ item }}"
  6. with_items:
  7. - colour.h
  8. - console.h
  9. - crypto.h
  10. - name: Copy netboot.xyz general.h.efi iPXE config
  11. ansible.builtin.copy:
  12. src: "ipxe/local/general.h.efi"
  13. dest: "{{ ipxe_source_dir }}/src/config/local/general.h"
  14. - name: Set trust file to ipxe ca
  15. ansible.builtin.set_fact:
  16. trust_files: "{{ cert_dir }}/{{ ipxe_ca_filename }}"
  17. when: not generate_signatures
  18. - name: Combine trust files if set
  19. ansible.builtin.set_fact:
  20. trust_files: "{{ cert_dir }}/{{ ipxe_ca_filename }},{{ cert_dir }}/{{ cert_file_filename }}"
  21. when: generate_signatures | bool
  22. - name: Compile iPXE bootloader for EFI
  23. ansible.builtin.shell: |
  24. make clean
  25. make CROSS_COMPILE=x86_64-linux-gnu- \
  26. ARCH=x86_64 \
  27. EMBED={{ bootloader_filename }} \
  28. TRUST={{ trust_files }} \
  29. bin-x86_64-efi/ipxe.efi \
  30. bin-x86_64-efi/snp.efi \
  31. bin-x86_64-efi/snponly.efi
  32. args:
  33. chdir: "{{ ipxe_source_dir }}/src"
  34. when: ipxe_debug_enabled | bool == false
  35. - name: Compile iPXE bootloader for EFI with debug flags
  36. ansible.builtin.shell: |
  37. make clean
  38. make CROSS_COMPILE=x86_64-linux-gnu- \
  39. ARCH=x86_64 \
  40. EMBED={{ bootloader_filename }} \
  41. DEBUG={{ ipxe_debug_options }} \
  42. TRUST={{ trust_files }} \
  43. bin-x86_64-efi/ipxe.efi \
  44. bin-x86_64-efi/snp.efi \
  45. bin-x86_64-efi/snponly.efi
  46. args:
  47. chdir: "{{ ipxe_source_dir }}/src"
  48. when: ipxe_debug_enabled | bool
  49. - name: Copy iPXE EFI builds to http directory
  50. ansible.builtin.copy:
  51. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  52. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  53. remote_src: true
  54. with_items:
  55. - {src: "bin-x86_64-efi/ipxe.efi", dest: "{{ bootloader_filename }}.efi"}
  56. - {src: "bin-x86_64-efi/snp.efi", dest: "{{ bootloader_filename }}-snp.efi"}
  57. - {src: "bin-x86_64-efi/snponly.efi", dest: "{{ bootloader_filename }}-snponly.efi"}