2017-03-26 21:33:16 +02:00
|
|
|
---
|
|
|
|
|
2018-07-26 17:59:49 +02:00
|
|
|
- name: Create group
|
|
|
|
group: name=fastd
|
|
|
|
|
|
|
|
- name: Create user
|
|
|
|
user: name=fastd group=fastd
|
|
|
|
|
2017-03-26 21:33:16 +02:00
|
|
|
- name: Install fastd
|
2017-06-30 11:59:14 +02:00
|
|
|
apt: name=fastd state=latest
|
2017-03-26 21:33:16 +02:00
|
|
|
|
|
|
|
- name: Install haveged (to create entropy)
|
|
|
|
apt: name=haveged
|
|
|
|
|
2017-11-09 21:21:19 +01:00
|
|
|
- name: Systemd unit for fastd
|
|
|
|
copy: src=fastd@.service dest=/etc/systemd/system/fastd@.service
|
2017-03-26 21:33:16 +02:00
|
|
|
notify:
|
|
|
|
- Reload systemd
|
|
|
|
- Restart fastd
|
|
|
|
|
2017-03-27 23:29:09 +02:00
|
|
|
- name: Disable fastd default instance
|
|
|
|
service: name=fastd enabled=no
|
|
|
|
|
2018-07-26 17:59:49 +02:00
|
|
|
- name: Create config directory
|
2018-01-21 20:46:21 +01:00
|
|
|
file: path=/etc/fastd/{{ site_code }} state=directory
|
|
|
|
|
2018-07-26 17:59:49 +02:00
|
|
|
- name: Create config directories
|
2018-01-21 20:46:21 +01:00
|
|
|
file: path=/etc/fastd/{{ site_code }}{{ item }}/peers state=directory
|
|
|
|
with_sequence: start=0 count={{ fastd_instances }}
|
2017-03-26 21:33:16 +02:00
|
|
|
|
|
|
|
- name: Configure fastd
|
2018-01-21 20:46:21 +01:00
|
|
|
template: src=fastd.conf.j2 dest=/etc/fastd/{{ site_code }}{{ item }}/fastd.conf
|
|
|
|
with_sequence: start=0 count={{ fastd_instances }}
|
2017-03-26 21:33:16 +02:00
|
|
|
notify: Restart fastd
|
|
|
|
|
|
|
|
- name: Generate fastd secret
|
2018-01-21 20:46:21 +01:00
|
|
|
fastd_key: path=/etc/fastd/{{ site_code }}/secret.conf
|
2017-03-26 21:33:16 +02:00
|
|
|
notify: Restart fastd
|
2017-03-27 23:29:09 +02:00
|
|
|
|
2018-07-26 17:59:49 +02:00
|
|
|
- name: Permissions (secret)
|
|
|
|
file: owner=fastd group=fastd path=/etc/fastd/{{ site_code }}/secret.conf
|
|
|
|
|
2018-01-21 20:46:21 +01:00
|
|
|
- name: Create symlinks (secret)
|
|
|
|
file: src=/etc/fastd/{{ site_code }}/secret.conf dest=/etc/fastd/{{ site_code }}{{ item }}/secret.conf state=link
|
|
|
|
with_sequence: start=0 count={{ fastd_instances }}
|
|
|
|
|
2019-03-27 14:47:33 +01:00
|
|
|
- name: Create Blacklist Script
|
2018-01-21 20:46:21 +01:00
|
|
|
copy: src=blacklist.sh dest=/etc/fastd/{{ site_code }}/blacklist.sh mode=0755 force=no
|
|
|
|
|
|
|
|
- name: Create symlinks (blacklist)
|
|
|
|
file: src=/etc/fastd/{{ site_code }}/blacklist.sh dest=/etc/fastd/{{ site_code }}{{ item }}/blacklist.sh state=link
|
|
|
|
with_sequence: start=0 count={{ fastd_instances }}
|
2018-01-14 20:23:08 +01:00
|
|
|
|
2019-03-27 14:47:33 +01:00
|
|
|
- name: Create Blacklist directory
|
|
|
|
file: path=/etc/fastd/{{ site_code }}/vpn-blacklist/ state=directory
|
|
|
|
|
|
|
|
- name: Create Blacklist file
|
2019-03-27 15:16:32 +01:00
|
|
|
copy: src=blacklist.json dest=/etc/fastd/{{ site_code }}/vpn-blacklist/blacklist.json mode=0644
|
2019-03-27 14:47:33 +01:00
|
|
|
|
2018-01-21 20:46:21 +01:00
|
|
|
- name: Enable fastd {{ site_code }}
|
|
|
|
service: name=fastd@{{ site_code }}{{ item }} enabled=yes
|
|
|
|
with_sequence: start=0 count={{ fastd_instances }}
|