main.yml 1.7 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: Install custom resolv.conf
  6. template: src=resolv.conf.j2 dest=/etc/resolv.conf
  7. - name: Make sure necessary tools are installed
  8. apt: name={{item}} state=present
  9. with_items:
  10. - wget
  11. - ntp
  12. - git
  13. - name: Install dependencies for ffrl tools
  14. apt: name={{item}}
  15. with_items:
  16. - python3
  17. - python3-pip
  18. - name: Start and enable supervisor
  19. service: name=supervisor state=started enabled=yes
  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: Create supervisor services
  28. template: src=supervisor.service.j2 dest=/etc/supervisor/conf.d/{{item.name}}.conf
  29. with_items: "{{supervisor_services}}"
  30. notify: Restart supervisor
  31. - name: Install ntp.conf
  32. template: src=ntp.conf.j2 dest=/etc/ntp.conf
  33. - name: Install python dependencies for ffrl tools
  34. pip: name={{item}} executable={{supernode_pip_executable}}
  35. with_items:
  36. - pyroute2
  37. - name: Create install dir for ffrl tools
  38. file: dest={{supernode_freifunk_tools_dir}} state=directory
  39. - name: Clone ffrl tools
  40. git: repo={{supernode_freifunk_tools_repo}} dest={{supernode_freifunk_tools_dir}}
  41. - name: Install nodeinfo cron job
  42. template: src=nodeinfo.cron.j2 dest=/etc/cron.d/nodeinfo
  43. notify: Restart cron