ansible/roles/batman/tasks/main.yml

78 lines
1.7 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:
- ruby
- ruby-dev
- build-essential
- curl
- dkms
- pkgconf
- libnl-genl-3-dev
- linux-headers-{{ ansible_kernel }}
- name: Install Ruby GEM
when: batman_dkms == true
gem: name=fpm-cookery
- name: Cloning FFNW Repo
when: batman_dkms == true
git: repo=https://git.ffnw.de/ffnw-server/ffnw-debian
dest=/opt/ffnw-debian
recursive=yes
force=yes
- name: Cook batman-adv-dkms
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
2018-02-04 18:32:45 +01:00
command: /usr/local/bin/fpm-cook
args:
chdir: /opt/ffnw-debian/batman-adv-dkms
- name: Get cooked Debian Packages to List
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
2018-02-04 18:32:45 +01:00
shell: "find *.deb"
register: pkg_list
args:
chdir: /opt/ffnw-debian/batman-adv-dkms/pkg
- name: Install batman-adv-dkms
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
2018-02-04 18:32:45 +01:00
command: "/usr/bin/dpkg -i {{ item }}"
args:
chdir: /opt/ffnw-debian/batman-adv-dkms/pkg
with_items:
- "{{ pkg_list.stdout_lines }}"
- name: Cook batctl
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
2018-02-04 18:32:45 +01:00
command: /usr/local/bin/fpm-cook
args:
chdir: /opt/ffnw-debian/batctl
- name: Get cooked Debian Packages to List
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
2018-02-04 18:32:45 +01:00
shell: "find *.deb"
register: pkg_list
args:
chdir: /opt/ffnw-debian/batctl/pkg
- name: Install batctl
2018-02-04 18:34:22 +01:00
when: batman_dkms == true
2018-02-04 18:32:45 +01:00
command: "/usr/bin/dpkg -i {{ item }}"
args:
chdir: /opt/ffnw-debian/batctl/pkg
with_items:
- "{{ pkg_list.stdout_lines }}"
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