generate_disks_efi.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 EMBED={{ bootloader_filename }} \
  26. TRUST={{ trust_files }} \
  27. bin-x86_64-efi/ipxe.efi \
  28. bin-x86_64-efi/snp.efi \
  29. bin-x86_64-efi/snponly.efi
  30. args:
  31. chdir: "{{ ipxe_source_dir }}/src"
  32. when: ipxe_debug_enabled | bool == false
  33. - name: Compile iPXE bootloader for EFI with debug flags
  34. ansible.builtin.shell: |
  35. make clean
  36. make EMBED={{ bootloader_filename }} \
  37. DEBUG={{ ipxe_debug_options }} \
  38. TRUST={{ trust_files }} \
  39. bin-x86_64-efi/ipxe.efi \
  40. bin-x86_64-efi/snp.efi \
  41. bin-x86_64-efi/snponly.efi
  42. args:
  43. chdir: "{{ ipxe_source_dir }}/src"
  44. when: ipxe_debug_enabled | bool
  45. - name: Copy iPXE EFI builds to http directory
  46. ansible.builtin.copy:
  47. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  48. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  49. remote_src: true
  50. with_items:
  51. - {src: "bin-x86_64-efi/ipxe.efi", dest: "{{ bootloader_filename }}.efi"}
  52. - {src: "bin-x86_64-efi/snp.efi", dest: "{{ bootloader_filename }}-snp.efi"}
  53. - {src: "bin-x86_64-efi/snponly.efi", dest: "{{ bootloader_filename }}-snponly.efi"}
  54. when: bootloader_filename != "netboot.xyz-metal"
  55. - name: Copy iPXE EFI builds to http directory for Equinix Metal
  56. ansible.builtin.copy:
  57. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  58. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  59. remote_src: true
  60. with_items:
  61. - {src: "bin-x86_64-efi/ipxe.efi", dest: "{{ bootloader_filename }}.efi"}
  62. when: bootloader_filename == "netboot.xyz-metal"