ansible-ffrgb/roles/fastd/tasks/main.yml

38 lines
1.0 KiB
YAML

---
- name: Install fastd
apt: name=fastd state=latest
- name: Install haveged (to create entropy)
apt: name=haveged
- name: Copy systemd unit file
command: /bin/cp /lib/systemd/system/fastd@.service /etc/systemd/system/fastd@.service creates=/etc/systemd/system/fastd@.service
- name: Fix systemd unit for fastd
lineinfile:
dest: /etc/systemd/system/fastd@.service
line: "ExecStopPost=/bin/rm -f /run/fastd-%I.sock"
regexp: "^ExecStopPost="
insertafter: "^ExecReload="
notify:
- Reload systemd
- Restart fastd
- name: Disable fastd default instance
service: name=fastd enabled=no
- name: Create directories
file: path=/etc/fastd/{{ fastd_instance }}/peers state=directory
- name: Configure fastd
template: src=fastd.conf.j2 dest=/etc/fastd/{{ fastd_instance }}/fastd.conf
notify: Restart fastd
- name: Generate fastd secret
fastd_key: path=/etc/fastd/{{ site_code }}/secret.conf
notify: Restart fastd
- name: Enable fastd {{ site_code }}
service: name=fastd@{{ site_code }} enabled=yes