ansible-ffrgb/roles/batman/tasks/main.yml

56 lines
1.6 KiB
YAML
Raw Normal View History

2017-03-27 17:39:04 +02:00
---
2018-02-04 18:32:45 +01:00
- name: Install batctl from apt
when: batman_dkms == false
apt: name=batctl state=latest
2017-03-27 17:39:04 +02:00
2018-02-04 18:32:45 +01:00
- 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
2018-02-04 18:32:45 +01:00
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 }}
2018-02-04 18:32:45 +01:00
- name: Unpack batman-adv source
2018-02-04 18:32:45 +01:00
when: batman_dkms == true
unarchive: src=/tmp/batman-adv-{{ batman-adv_version }}.tar.gz
dest=/usr/src/
copy=no
2018-02-04 18:32:45 +01:00
- name: Install dkms.conf
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
template: src=dkms.conf.j2
dest="/usr/src/batman-adv-{{ batman-adv_version }}/dkms.conf"
2018-02-04 18:32:45 +01:00
- name: Add module via dkms
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
command: dkms add -m batman-adv -v "{{ batman-adv_version }}"
2018-02-04 18:32:45 +01:00
- name: Build module via dkms
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
command: dkms build -m batman-adv -v "{{ batman-adv_version }}"
2018-02-04 18:32:45 +01:00
- name: Install module via dkms
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
command: dkms install -m batman-adv -v "{{ batman-adv_version }}"
2018-02-04 18:32:45 +01:00
- name: Rebuild kernel initramfs
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
command: update-initramfs -c -k all
2018-02-04 18:32:45 +01:00
2017-03-27 17:39:04 +02:00
- name: Enable batman during boot
lineinfile: dest=/etc/modules line=batman-adv
- name: Load batman-adv module
modprobe: name=batman-adv