main.yml 804 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. - name: Ensure permission on fastd directory
  3. become: true
  4. file:
  5. path: /etc/fastd
  6. state: directory
  7. mode: 0700
  8. - name: Create configuration directories
  9. become: true
  10. file:
  11. dest: "/etc/fastd/{{ item.name }}"
  12. state: directory
  13. mode: 0700
  14. when: item.type == "fastd"
  15. loop: "{{ peers | flatten(levels=1) }}"
  16. - name: Install fastd configuration
  17. become: true
  18. template:
  19. src: templates/config.j2
  20. dest: "/etc/fastd/{{ item.name }}/fastd.conf"
  21. mode: 0644
  22. when: item.type == "fastd"
  23. loop: "{{ peers | flatten(levels=1) }}"
  24. - name: Enable fastd interfaces for autostart
  25. become: true
  26. systemd:
  27. name: "fastd@{{ item.name }}"
  28. masked: false
  29. enabled: true
  30. state: restarted
  31. when: item.type == "fastd"
  32. loop: "{{ peers | flatten(levels=1) }}"