---
# This playbook builds the asset grubx64.efi for the EFI partition
- name: Create and mount loop device for temporary EFI layer
  hosts: build_host:&grub_efi
  vars_files:
    - ../vars/grub_efi.yml
  tags:
    - create_and_mount_loop
  roles:
    - { role: create_loop_device, tags: create_loop_device }
    - { role: mount_overlay, tags: mount_overlay }

- name: Create grub.efi
  hosts: chroot:&grub_efi
  vars_files:
    - ../vars/grub_efi.yml
  roles:
    - { role: grub_efi, tags: grub_efi }

- name: Move grub.efi to build directory and unmount overlay
  hosts: build_host:&grub_efi
  vars_files:
    - ../vars/grub_efi.yml
  roles:
    - { role: grub_efi_extract, tags: grub_efi_extract }
    - { role: unmount_overlay, tags: unmount_overlay }
