ansible/roles/batman/tasks/main.yml
2018-02-04 18:34:22 +01:00

78 lines
1.7 KiB
YAML

---
- 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:
- 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
when: batman_dkms == true
command: /usr/local/bin/fpm-cook
args:
chdir: /opt/ffnw-debian/batman-adv-dkms
- name: Get cooked Debian Packages to List
when: batman_dkms == true
shell: "find *.deb"
register: pkg_list
args:
chdir: /opt/ffnw-debian/batman-adv-dkms/pkg
- name: Install batman-adv-dkms
when: batman_dkms == true
command: "/usr/bin/dpkg -i {{ item }}"
args:
chdir: /opt/ffnw-debian/batman-adv-dkms/pkg
with_items:
- "{{ pkg_list.stdout_lines }}"
- name: Cook batctl
when: batman_dkms == true
command: /usr/local/bin/fpm-cook
args:
chdir: /opt/ffnw-debian/batctl
- name: Get cooked Debian Packages to List
when: batman_dkms == true
shell: "find *.deb"
register: pkg_list
args:
chdir: /opt/ffnw-debian/batctl/pkg
- name: Install batctl
when: batman_dkms == true
command: "/usr/bin/dpkg -i {{ item }}"
args:
chdir: /opt/ffnw-debian/batctl/pkg
with_items:
- "{{ pkg_list.stdout_lines }}"
- name: Enable batman during boot
lineinfile: dest=/etc/modules line=batman-adv
- name: Load batman-adv module
modprobe: name=batman-adv