forked from FF-RGB/ansible
Cleanup fastd role
This commit is contained in:
parent
b57bc04e1c
commit
34ce42c73b
12
roles/fastd/files/fastd@.service
Normal file
12
roles/fastd/files/fastd@.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Fast and Secure Tunnelling Daemon (connection %I)
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
ExecStart=/usr/bin/fastd --syslog-level info --syslog-ident fastd@%I -c /etc/fastd/%I/fastd.conf
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
ExecStopPost=/bin/rm -f /run/fastd-%I.sock
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -6,15 +6,8 @@
|
|||||||
- name: Install haveged (to create entropy)
|
- name: Install haveged (to create entropy)
|
||||||
apt: name=haveged
|
apt: name=haveged
|
||||||
|
|
||||||
- name: Copy systemd unit file
|
- name: Systemd unit for fastd
|
||||||
command: /bin/cp /lib/systemd/system/fastd@.service /etc/systemd/system/fastd@.service creates=/etc/systemd/system/fastd@.service
|
copy: src=fastd@.service dest=/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:
|
notify:
|
||||||
- Reload systemd
|
- Reload systemd
|
||||||
- Restart fastd
|
- Restart fastd
|
||||||
@ -30,8 +23,8 @@
|
|||||||
notify: Restart fastd
|
notify: Restart fastd
|
||||||
|
|
||||||
- name: Generate fastd secret
|
- name: Generate fastd secret
|
||||||
fastd_key: path=/etc/fastd/{{ site_code }}/secret.conf
|
fastd_key: path=/etc/fastd/{{ fastd_instance }}/secret.conf
|
||||||
notify: Restart fastd
|
notify: Restart fastd
|
||||||
|
|
||||||
- name: Enable fastd {{ site_code }}
|
- name: Enable fastd {{ fastd_instance }}
|
||||||
service: name=fastd@{{ site_code }} enabled=yes
|
service: name=fastd@{{ fastd_instance }} enabled=yes
|
||||||
|
Loading…
Reference in New Issue
Block a user