main.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. # tasks file for ff-supernode
  3. - include_vars: "{{ ansible_distribution }}-{{ansible_distribution_release }}.yml"
  4. when: ansible_distribution_release == 'wheezy' and ansible_distribution == 'Debian'
  5. - name: Ensure package resolvconf is absent
  6. apt: name=resolvconf stage=absent purge=yes
  7. - name: Install custom resolv.conf
  8. template: src=resolv.conf.j2 dest=/etc/resolv.conf
  9. - name: Make sure necessary tools are installed
  10. apt: name={{item}} state=present
  11. with_items:
  12. - wget
  13. - ntp
  14. - git
  15. - name: Install dependencies for ffrl tools
  16. apt: name={{item}}
  17. with_items:
  18. - python3
  19. - python3-pip
  20. - name: Install crontab to update the blacklist
  21. cron:
  22. name: Update blacklist
  23. minute: '*/5'
  24. job: wget -q -O /etc/fastd/fastd-blacklist.json https://raw.githubusercontent.com/ffruhr/fastdbl/master/fastd-blacklist.json
  25. - name: Install verify shell script
  26. template: src=fastd-blacklist.sh.j2 dest=/etc/fastd/fastd-blacklist.sh mode="u=rwx,g=rx,o=r"
  27. - name: Install systemd services
  28. template: src={{item}}.service.j2 dest=/etc/systemd/system/{{item}}.service
  29. with_items:
  30. - alfred
  31. - batadv-vis
  32. - name: Enable and start systemd services
  33. service: name={{item}} enabled=yes state=started
  34. with_items:
  35. - alfred
  36. - batadv-vis
  37. - name: Install ntp.conf
  38. template: src=ntp.conf.j2 dest=/etc/ntp.conf
  39. - name: Install python dependencies for ffrl tools
  40. pip: name={{item}} executable={{supernode_pip_executable}}
  41. with_items:
  42. - pyroute2
  43. - name: Create install dir for ffrl tools
  44. file: dest={{supernode_freifunk_tools_dir}} state=directory
  45. - name: Clone ffrl tools
  46. git: repo={{supernode_freifunk_tools_repo}} dest={{supernode_freifunk_tools_dir}}
  47. - name: Install nodeinfo cron job
  48. template: src=nodeinfo.cron.j2 dest=/etc/cron.d/nodeinfo