blob: 9602378a6789c71260499502f4d6719256585d4e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
---
- name: "Ensure proxmox-kernel-helper is installed"
become: true
ansible.builtin.apt:
name: "proxmox-kernel-helper"
state: "present"
- name: "Check if proxmox-boot-tool already initialized"
ansible.builtin.stat:
path: "/etc/kernel/proxmox-boot-uuids"
register: proxmox_boot_tool_uuids
- name: "Initialize proxmox-boot-tool"
become: true
when: not proxmox_boot_tool_uuids.stat.exists
tags:
# Since there is no EFI partition on container environment, ignoring this block
- "molecule-notest"
block:
- name: "Get EFI partition device"
ansible.builtin.command:
cmd: "blkid -l -t PARTLABEL=boot -o device"
register: proxmox_boot_tool_efi_device
changed_when: false
- name: "Unmount EFI partition"
ansible.builtin.command:
cmd: "umount /boot/efi"
register: proxmox_boot_tool_umount
changed_when: proxmox_boot_tool_umount.rc == 0
failed_when: proxmox_boot_tool_umount.rc not in [0, 32]
- name: "Initialize proxmox-boot-tool on EFI partition"
ansible.builtin.command:
cmd: "proxmox-boot-tool init {{ proxmox_boot_tool_efi_device.stdout | trim }} grub"
changed_when: true
- name: "Sync kernels to EFI partition"
ansible.builtin.command:
cmd: "proxmox-boot-tool refresh"
changed_when: true
- name: "Remount EFI partition"
ansible.posix.mount:
path: "/boot/efi"
src: "{{ proxmox_boot_tool_efi_device.stdout | trim }}"
fstype: "vfat"
state: "ephemeral"
|