main.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ---
  2. # tasks file for alfred
  3. - include: debian.yml
  4. when: ansible_os_family == 'Debian'
  5. - name: Download alfred source code
  6. get_url: dest=/usr/src url={{alfred_source_url}}
  7. - name: Extract alfred source code
  8. unarchive: src=/usr/src/alfred-{{alfred_version}}.tar.gz dest=/usr/src copy=no
  9. - name: Copy libcap patch to src directory
  10. when: alfred_libcap_dev_broken
  11. template: src=libcap.patch.j2 dest=/usr/src/alfred-{{alfred_version}}/libcap.patch
  12. - name: Patch makefile to fix broken libcap-dev package on Debian and Ubuntu
  13. when: alfred_libcap_dev_broken
  14. patch: basedir=/usr/src/alfred-{{alfred_version}} src=/usr/src/alfred-{{alfred_version}}/libcap.patch remote_src=True strip=0
  15. - set_fact:
  16. alfred_config_gps: "CONFIG_ALFRED_GPSD=n"
  17. when: not alfred_gps
  18. - set_fact:
  19. alfred_config_vis: "CONFIG_ALFRED_VIS=n"
  20. when: not alfred_vis
  21. - name: Compile and install alfred
  22. shell: "make {{alfred_config_gps|default('')}} {{alfred_config_vis|default('')}} && make {{alfred_config_gps|default('')}} {{alfred_config_vis|default('')}} install"
  23. args:
  24. chdir: /usr/src/alfred-{{alfred_version}}
  25. - name: Install init script and defaults for alfred
  26. template: src="{{item.src}}" dest="{{item.dest}}" mode="{{item.mode}}"
  27. with_items:
  28. - src: alfred.init.j2
  29. dest: /etc/init.d/alfred
  30. mode: "u=rwx,g=r,o=r"
  31. - src: alfred.default.j2
  32. dest: /etc/default/alfred
  33. mode: "u=rw,g=r,o=r"
  34. - name: Install init script and defaults for batadv-vis
  35. when: alfred_vis is defined and alfred_vis
  36. template: src="{{item.src}}" dest="{{item.dest}}" mode="{{item.mode}}"
  37. with_items:
  38. - src: batadv-vis.init.j2
  39. dest: /etc/init.d/batadv-vis
  40. mode: "u=rwx,g=r,o=r"
  41. - src: batadv-vis.default.j2
  42. dest: /etc/default/batadv-vis
  43. mode: "u=rw,g=r,o=r"
  44. - name: Start and enable alfred
  45. service: name=alfred state=started enabled=yes
  46. - name: Start and enable batadv-vis service
  47. when: alfred_vis is defined and alfred_vis
  48. service: name=batadv-vis state=started enabled=yes