--- - name: Install DKMS and the compiler (no recommends, they would pull generic Debian headers) ansible.builtin.apt: name: [dkms, gcc, make] state: present install_recommends: false - name: Download the Falco tarball (only its driver source is used) ansible.builtin.get_url: url: "{{ falco_tarball_url }}" dest: "{{ falco_tarball_path }}" checksum: "sha256:{{ falco_tarball_sha256 }}" mode: "0644" - name: Extract the Falco driver source into /usr/src ansible.builtin.unarchive: src: "{{ falco_tarball_path }}" remote_src: true dest: /usr/src include: ["falco-{{ falco_version }}-aarch64/usr/src/falco-{{ falco_driver_version }}"] extra_opts: ["--strip-components=3"] creates: "/usr/src/falco-{{ falco_driver_version }}/dkms.conf" - name: Check the Falco driver's DKMS status for the running kernel ansible.builtin.command: dkms status -m falco -v {{ falco_driver_version }} -k {{ ansible_facts['kernel'] }} register: falco_dkms changed_when: false - name: Register the Falco driver source with DKMS ansible.builtin.command: dkms add -m falco -v {{ falco_driver_version }} when: falco_dkms.stdout == "" - name: Build and install the Falco driver for the running kernel ansible.builtin.command: dkms install -m falco -v {{ falco_driver_version }} -k {{ ansible_facts['kernel'] }} when: "'installed' not in falco_dkms.stdout" - name: Load the Falco module at boot ansible.builtin.copy: dest: /etc/modules-load.d/falco.conf content: "falco\n" mode: "0644" - name: Load the Falco module now ansible.builtin.command: modprobe falco args: creates: /sys/module/falco