main.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. # tasks file for fastd
  3. - include: repo.yml
  4. - include: libsodium/main.yml
  5. - include: libuecc/main.yml
  6. - include: debian.yml
  7. when: ansible_distribution == "Ubuntu"
  8. - include: debian.yml
  9. when: ansible_distribution == "Debian"
  10. - name: Create fastd config directories
  11. file: path=/etc/fastd/{{item.name}} state=directory recurse=yes
  12. with_items:
  13. - "{{fastd_instances}}"
  14. - name: Create fastd configs
  15. template: src=fastd.conf.j2 dest=/etc/fastd/{{item.name}}/fastd.conf
  16. with_items: "{{fastd_instances}}"
  17. notify: Restart fastd
  18. - name: Create fastd secrets
  19. template: src=secret.conf.j2 dest=/etc/fastd/{{item.name}}/secret.conf
  20. with_items: "{{fastd_instances_secret}}"
  21. notify: Restart fastd
  22. - name: Create fastd peer include directories
  23. when: item.peer_dir is defined
  24. file: dest={{item.peer_dir}} state=directory
  25. with_items: "{{fastd_instances}}"
  26. - name: Create fastd peer configs
  27. when: item.0.peer_dir is defined
  28. template: src=peer.config.j2 dest="{{item.0.peer_dir}}/{{item.1.name}}"
  29. with_subelements:
  30. - "{{fastd_instances | selectattr('peers', 'defined') | list}}"
  31. - peers
  32. - name: rng-tools need to run
  33. when: fastd_use_rng
  34. service: name=rng-tools state=started enabled=yes pattern=/usr/sbin/rngd
  35. - name: fastd needs to autostart
  36. service: name=fastd enabled=yes state=started