main.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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: Make sure necessary tools are installed
  6. apt: name={{item}} state=present
  7. with_items:
  8. - wget
  9. - ntp
  10. - git
  11. - name: Install dependencies for ffrl tools
  12. apt: name={{item}}
  13. with_items:
  14. - python3
  15. - python3-pip
  16. - name: Install crontab to update the blacklist
  17. cron:
  18. name: Update blacklist
  19. minute: '*/5'
  20. job: wget -q -O /etc/fastd/fastd-blacklist.json https://raw.githubusercontent.com/ffruhr/fastdbl/master/fastd-blacklist.json
  21. - name: Install verify shell script
  22. template: src=fastd-blacklist.sh.j2 dest=/etc/fastd/fastd-blacklist.sh mode="u=rwx,g=rx,o=r"
  23. - name: Install systemd services
  24. template: src={{item}}.service.j2 dest=/etc/systemd/system/{{item}}.service
  25. with_items:
  26. - alfred
  27. - batadv-vis
  28. - name: Enable and start systemd services
  29. service: name={{item}} enabled=yes state=started
  30. with_items:
  31. - alfred
  32. - batadv-vis
  33. - name: Install ntp.conf
  34. template: src=ntp.conf.j2 dest=/etc/ntp.conf
  35. - name: Install python dependencies for ffrl tools
  36. pip: name={{item}} executable={{supernode_pip_executable}}
  37. with_items:
  38. - pyroute2
  39. - name: Create install dir for ffrl tools
  40. file: dest={{supernode_freifunk_tools_dir}} state=directory
  41. - name: Clone ffrl tools
  42. git: repo={{supernode_freifunk_tools_repo}} dest={{supernode_freifunk_tools_dir}}
  43. - name: Install nodeinfo cron job
  44. template: src=nodeinfo.cron.j2 dest=/etc/cron.d/nodeinfo