aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/microcode/tasks
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-10-25 03:56:20 +0300
committerEgor Tensin <egor@tensin.name>2026-10-25 03:56:20 +0300
commite5a6c44a98f23e0bef231f413de9fdcc6dd2663b (patch)
treeec88fc041ed6cb41fa60094a740efd4d011e4a11 /roles/microcode/tasks
parentv8.1.1 (diff)
downloadinfra-ansible-e5a6c44a98f23e0bef231f413de9fdcc6dd2663b.tar.gz
infra-ansible-e5a6c44a98f23e0bef231f413de9fdcc6dd2663b.zip
import roles kernel & microcode from infra-metal
Diffstat (limited to 'roles/microcode/tasks')
-rw-r--r--roles/microcode/tasks/main.yml29
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/microcode/tasks/main.yml b/roles/microcode/tasks/main.yml
new file mode 100644
index 0000000..26ffd5f
--- /dev/null
+++ b/roles/microcode/tasks/main.yml
@@ -0,0 +1,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