--- # tasks file for alfred - include: debian.yml when: ansible_os_family == 'Debian' - name: Download alfred source code get_url: dest=/usr/src url={{alfred_source_url}} - name: Extract alfred source code unarchive: src=/usr/src/alfred-{{alfred_version}}.tar.gz dest=/usr/src copy=no - name: Copy libcap patch to src directory when: alfred_libcap_dev_broken template: src=libcap.patch.j2 dest=/usr/src/alfred-{{alfred_version}}/libcap.patch - name: Patch makefile to fix broken libcap-dev package on Debian and Ubuntu when: alfred_libcap_dev_broken patch: basedir=/usr/src/alfred-{{alfred_version}} src=/usr/src/alfred-{{alfred_version}}/libcap.patch remote_src=True strip=0 - set_fact: alfred_config_gps: "CONFIG_ALFRED_GPSD=n" when: not alfred_gps - set_fact: alfred_config_vis: "CONFIG_ALFRED_VIS=n" when: not alfred_vis - name: Compile and install alfred shell: "make {{alfred_config_gps|default('')}} {{alfred_config_vis|default('')}} && make {{alfred_config_gps|default('')}} {{alfred_config_vis|default('')}} install" args: chdir: /usr/src/alfred-{{alfred_version}} - name: Install init script and defaults for alfred template: src="{{item.src}}" dest="{{item.dest}}" mode="{{item.mode}}" with_items: - src: alfred.init.j2 dest: /etc/init.d/alfred mode: "u=rwx,g=r,o=r" - src: alfred.default.j2 dest: /etc/default/alfred mode: "u=rw,g=r,o=r" - name: Install init script and defaults for batadv-vis when: alfred_vis is defined and alfred_vis template: src="{{item.src}}" dest="{{item.dest}}" mode="{{item.mode}}" with_items: - src: batadv-vis.init.j2 dest: /etc/init.d/batadv-vis mode: "u=rwx,g=r,o=r" - src: batadv-vis.default.j2 dest: /etc/default/batadv-vis mode: "u=rw,g=r,o=r" - name: Start and enable alfred service: name=alfred state=started enabled=yes - name: Start and enable batadv-vis service when: alfred_vis is defined and alfred_vis service: name=batadv-vis state=started enabled=yes