--- - name: Install batctl from apt when: batman_dkms == false apt: name=batctl state=latest - name: Install dependencies for building DKMS when: batman_dkms == true apt: name={{ item }} with_items: - build-essential - curl - dkms - pkgconf - libnl-genl-3-dev - linux-headers-{{ ansible_kernel }} - name: Download batman-adv source when: batman_dkms == true get_url: url="https://downloads.open-mesh.org/batman/releases/batman-adv-{{ batman-adv_version }}/batman-adv-{{ batman-adv_version }}.tar.gz" dest=/tmp/batman-adv-{{ batman-adv_version }}.tar.gz checksum=sha256:{{ batman-adv_tar_sha256_hash }} - name: Unpack batman-adv source when: batman_dkms == true unarchive: src=/tmp/batman-adv-{{ batman-adv_version }}.tar.gz dest=/usr/src/ copy=no - name: Install dkms.conf when: batman_dkms == true template: src=dkms.conf.j2 dest="/usr/src/batman-adv-{{ batman-adv_version }}/dkms.conf" - name: Add module via dkms when: batman_dkms == true command: dkms add -m batman-adv -v "{{ batman-adv_version }}" - name: Build module via dkms when: batman_dkms == true command: dkms build -m batman-adv -v "{{ batman-adv_version }}" - name: Install module via dkms when: batman_dkms == true command: dkms install -m batman-adv -v "{{ batman-adv_version }}" - name: Rebuild kernel initramfs when: batman_dkms == true command: update-initramfs -c -k all - name: Enable batman during boot lineinfile: dest=/etc/modules line=batman-adv - name: Load batman-adv module modprobe: name=batman-adv