summaryrefslogtreecommitdiff
path: root/roles/prepare-dkms/tasks/raspberrypi.yml
blob: 1b6f1a53236ed99b265ef2c90f31540aea5cf18b (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
---
- name: install legacy raspberry kernel-headers
  when: (ansible_distribution_release | debian_release_compare('<=', 'bullseye'))
  apt:
    name:
    - raspberrypi-kernel-headers
    - dkms
    state: present

- when: (ansible_distribution_release | debian_release_compare('>', 'bullseye'))
  block:
  - name: figure out which kernel is currently running
    check_mode: no
    command: uname -r
    changed_when: false
    register: raspberry_pi_uname

  - name: install raspberry kernel-headers
    apt:
      name:
      - "linux-headers-rpi-{{ raspberry_pi_uname.stdout | split('-') | last }}"
      - dkms
      state: present