generate_disks_efi.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. 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. tags:
  33. - skip_ansible_lint
  34. when: ipxe_debug_enabled | bool == false
  35. - name: Compile iPXE bootloader for EFI with debug flags
  36. shell: |
  37. make clean
  38. make EMBED={{ bootloader_filename }} \
  39. DEBUG={{ ipxe_debug_options }} \
  40. TRUST={{ trust_files }} \
  41. bin-x86_64-efi/ipxe.efi \
  42. bin-x86_64-efi/snp.efi \
  43. bin-x86_64-efi/snponly.efi
  44. args:
  45. chdir: "{{ ipxe_source_dir }}/src"
  46. tags:
  47. - skip_ansible_lint
  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"}
  58. when: bootloader_filename != "netboot.xyz-metal"
  59. - name: Copy iPXE EFI builds to http directory for Equinix Metal
  60. ansible.builtin.copy:
  61. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  62. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  63. remote_src: true
  64. with_items:
  65. - {src: "bin-x86_64-efi/ipxe.efi", dest: "{{ bootloader_filename }}.efi"}
  66. when: bootloader_filename == "netboot.xyz-metal"