aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/microcode/tasks/main.yml
blob: 26ffd5f9c9b5a47ad54d55d9588117350ff225dd (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
- name: Get host processor
  ansible.builtin.setup:
    gather_subset:
      - processor
      - distribution

- name: Fail unless Arch Linux
  when: |
    ansible_facts['distribution'] != 'Archlinux'
  ansible.builtin.fail:
    msg: Only works on Arch Linux

- name: Install microcode package
  when: |
    'GenuineIntel' in ansible_facts["processor"]
  become: true
  ansible.builtin.package:
    name: intel-ucode
    state: present
  notify: microcode_installed

- name: Install AMD microcode package
  when: |
    'AuthenticAMD' in ansible_facts["processor"]
  become: true
  ansible.builtin.package:
    name: amd-ucode
    state: present
  notify: microcode_installed