lae / ansible-role-proxmox

IaC for Proxmox VE clusters.
MIT License
468 stars 139 forks source link

Add pinning of proxmox-default-kernel #243

Open btravouillon opened 1 month ago

btravouillon commented 1 month ago

We had some issues with the latest kernel 6.8 shipped with Proxmox 8.2.

These issues were somewhat expected as per https://pve.proxmox.com/wiki/Roadmap#Kernel_6.8. Proxmox proposal is to " create a file in /etc/apt/preferences.d/proxmox-default-kernel with the following content." to use the previous kernel 6.5.

Package: proxmox-default-kernel
Pin: version 1.0.1
Pin-Priority: 1000

We implemented a pre-task in our playbook, however, it would be nice to support such feature in the proxmox role.

I should be able to create a PR soon, but since I'm quite busy this week, I file this feature request (to not forget). Feel free to assign this ticket to me. :wink:

    # Workaround
    - name: Pin the Proxmox kernel
      ansible.builtin.copy:
        content: |
          Package: proxmox-default-kernel
          Pin: version {{ pve_pin_default_kernel }}
          Pin-Priority: 1000
        dest: /etc/apt/preferences.d/proxmox-default-kernel
        mode: 0644
      when: pve_pin_default_kernel is defined
lae commented 1 week ago

@btravouillon assigned to you, but I might go ahead and do this if you're busy so I can include this in the next release.

I think this task should probably be after - import_tasks: identify_needed_packages.yml (line 170 in main.yml)/before the PVE install task, or maybe it's best before all of the apt tasks (line 150)?

I'd include the link to the wiki in the README when you add the role variable to it, too.

lae commented 1 week ago

Also maybe pve_default_kernel_version is a better name given the content. The current name makes me think it should be a boolean.