123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- - name: Abhängigkeiten installieren
- apt:
- pkg: "{{ item }}"
- state: present
- with_items:
- - dkms
- - build-essential
- - linux-headers-{{ansible_kernel}}
- - checkinstall
- - pkg-config
- - libnl-3-dev
- - libnl-genl-3-dev
- - name: create directory for batman-adv
- file:
- name: /opt/batman-adv
- state: directory
- - name: Download Batman
- get_url:
- url: "https://downloads.open-mesh.org/batman/releases/batman-adv-{{batman_version}}/batman-adv-{{batman_version}}.tar.gz"
- dest: /opt/batman-adv/batman-adv-{{batman_version}}.tar.gz
- register: getbatman
- - name: batman-Quellen entpacken
- unarchive:
- src: /opt/batman-adv/batman-adv-{{batman_version}}.tar.gz
- dest: /usr/src
- remote_src: True
- when:
- - getbatman.changed
- - name: configure dkms
- template:
- src: dkms.conf
- dest: /usr/src/batman-adv-{{batman_version}}/dkms.conf
- - stat:
- path: /lib/modules/{{ansible_kernel}}/updates/dkms/batman-adv.ko
- register: batman_adv_file
- - name: Batman bauen
- shell: "dkms add -m batman-adv -v {{batman_version}} && dkms build -m batman-adv -v {{batman_version}} && dkms install -m batman-adv -v {{batman_version}}"
- when:
- - batman_adv_file.stat.exists == False or getbatman.changed
- # batctl
- - name: create directory for batctl
- file:
- name: /opt/batctl
- state: directory
- - name: get batctl
- get_url:
- url: "https://downloads.open-mesh.org/batman/releases/batman-adv-{{batman_version}}/batctl-{{batman_version}}.tar.gz"
- dest: /opt/batctl/batctl-{{batman_version}}.tar.gz
- register: getbatctl
- - name: batctl-Quellen und entpacken
- unarchive:
- src: /opt/batctl/batctl-{{batman_version}}.tar.gz
- dest: /usr/src
- remote_src: True
- when:
- - getbatctl.changed
- - stat: path=/usr/local/sbin/batctl
- register: batctl
- - name: batctl Version prüfen
- shell: '{{batctl.stat.path}} -v | grep -oE "batctl [0-9]+\.[0-9]+"'
- when:
- - batctl.stat.exists == True
- changed_when: False
- register: batctl_version
- check_mode: no
- - name: batctl bauen
- shell: "make && checkinstall -y make install"
- args:
- chdir: /usr/src/batctl-{{batman_version}}
- when:
- - batctl.stat.exists == False or batctl_version.stdout_lines[0] != "batctl {{batman_version}}"
- # - batctl.stat.exists == False or batctl_version.stdout_lines[0] != "batctl batman_version"
|