2025-09-02 13:04:30 +02:00
|
|
|
---
|
|
|
|
|
- name: Fix GRUB nouveau errors and reboot
|
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
|
path: /etc/default/grub
|
|
|
|
|
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT=".*quiet'
|
|
|
|
|
# line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet"'
|
|
|
|
|
line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet nouveau.modeset=0"'
|
|
|
|
|
register: grubfix
|
2025-09-02 14:37:33 +02:00
|
|
|
when: "'ThinkPad' in ansible_local['cpu_info']['productname']"
|
2025-09-02 13:04:30 +02:00
|
|
|
|
|
|
|
|
- name: Update grub # noqa: no-handler
|
|
|
|
|
ansible.builtin.command: update-grub
|
|
|
|
|
when: grubfix.changed
|
|
|
|
|
changed_when: grubfix.changed
|
|
|
|
|
|
|
|
|
|
- name: Reboot after fixing GRUB # noqa: no-handler
|
|
|
|
|
ansible.builtin.reboot:
|
|
|
|
|
when: grubfix.changed
|
|
|
|
|
changed_when: grubfix.changed
|
|
|
|
|
|
|
|
|
|
- name: Install additional firmware
|
|
|
|
|
ansible.builtin.apt:
|
|
|
|
|
pkg:
|
|
|
|
|
- firmware-realtek
|
|
|
|
|
- firmware-misc-nonfree
|
|
|
|
|
- firmware-iwlwifi
|
|
|
|
|
- firmware-sof-signed
|
|
|
|
|
state: present
|
|
|
|
|
when: "'proxmox_servers' not in group_names"
|
|
|
|
|
|
2025-09-02 14:37:33 +02:00
|
|
|
- name: Inform user of the intention with the microcode package
|
|
|
|
|
ansible.builtin.debug:
|
|
|
|
|
msg: "This is an Intel system, but it is a libreboot system. Removing intel-microcode package."
|
|
|
|
|
when: "'GenuineIntel' in ansible_facts['processor'] and 'installed' in ansible_local['cpu_info']['libreboot']"
|
|
|
|
|
|
|
|
|
|
- name: Remove intel-microcode on Intel libreboot systems
|
|
|
|
|
ansible.builtin.apt:
|
|
|
|
|
name: intel-microcode
|
|
|
|
|
state: absent
|
|
|
|
|
purge: true
|
|
|
|
|
when: "'GenuineIntel' in ansible_facts['processor'] and 'installed' in ansible_local['cpu_info']['libreboot']"
|
|
|
|
|
|
|
|
|
|
- name: Install intel-microcode on Intel non-libreboot systems
|
2025-09-02 13:04:30 +02:00
|
|
|
ansible.builtin.apt:
|
|
|
|
|
name: intel-microcode
|
|
|
|
|
state: present
|
2025-09-02 14:37:33 +02:00
|
|
|
when: "'GenuineIntel' in ansible_facts['processor'] and 'installed' not in ansible_local['cpu_info']['libreboot']"
|