2017-09-05 12:01:27 +02:00
|
|
|
---
|
2017-10-03 20:25:17 +02:00
|
|
|
- name: configure systemd unit fastd@
|
|
|
|
systemd:
|
|
|
|
name: "fastd@{{ item.key }}VPN"
|
|
|
|
enabled: yes
|
|
|
|
with_dict: "{{ meshes }}"
|
2017-09-05 12:01:27 +02:00
|
|
|
|
|
|
|
- name: create fastd directories
|
|
|
|
file:
|
|
|
|
path: "/etc/fastd/{{ item.key }}VPN"
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
with_dict: "{{ meshes }}"
|
|
|
|
|
2017-10-03 20:25:17 +02:00
|
|
|
- name: create fastd peer mesh directories
|
|
|
|
file:
|
|
|
|
path: "/etc/fastd/{{ item.key }}VPN/peers"
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
owner: admin
|
|
|
|
group: admin
|
|
|
|
with_dict: "{{ meshes }}"
|
|
|
|
|
|
|
|
- name: create fastd peer mesh directories for ffbin
|
|
|
|
file:
|
|
|
|
path: "/etc/fastd/mzVPN/peers_bingen"
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
owner: admin
|
|
|
|
group: admin
|
|
|
|
|
|
|
|
- name: clone fastd peer mesh repos
|
|
|
|
git:
|
|
|
|
repo: "{{ item.value.peers_mesh_repo }}"
|
|
|
|
dest: "/etc/fastd/{{ item.key }}VPN/peers"
|
|
|
|
version: master
|
|
|
|
update: no
|
|
|
|
with_dict: "{{ meshes }}"
|
|
|
|
become: false
|
|
|
|
|
|
|
|
- name: clone fastd peer mesh repo for ffbin
|
|
|
|
git:
|
|
|
|
repo: https://github.com/freifunk-bingen/peers-ffbin.git
|
|
|
|
dest: /etc/fastd/mzVPN/peers_bingen
|
|
|
|
version: master
|
|
|
|
update: no
|
|
|
|
become: false
|
|
|
|
|
2017-09-05 12:01:27 +02:00
|
|
|
- name: template fastd mesh config
|
|
|
|
template:
|
|
|
|
src: fastd-mesh.conf.j2
|
|
|
|
dest: "/etc/fastd/{{ item.key }}VPN/fastd.conf"
|
2017-10-03 20:25:17 +02:00
|
|
|
notify: restart fastd mesh instances
|
2017-09-05 12:01:27 +02:00
|
|
|
with_dict: "{{ meshes }}"
|
|
|
|
|
|
|
|
- name: write fastd mesh secret
|
|
|
|
template:
|
|
|
|
src: fastd-secret.conf.j2
|
|
|
|
dest: "/etc/fastd/{{ item.key }}VPN/secret.conf"
|
2017-10-03 20:25:17 +02:00
|
|
|
notify: restart fastd mesh instances
|
2017-09-05 12:01:27 +02:00
|
|
|
with_dict: "{{ meshes }}"
|
2017-10-03 23:30:02 +02:00
|
|
|
|
2017-10-06 10:33:38 +02:00
|
|
|
- name: copy peer_limit.conf if not exist
|
|
|
|
copy:
|
|
|
|
src: peer_limit.conf
|
|
|
|
dest: "/etc/fastd/{{ item.key }}VPN/peer_limit.conf"
|
|
|
|
owner: admin
|
|
|
|
group: admin
|
|
|
|
mode: 0640
|
|
|
|
force: no
|
|
|
|
notify: restart fastd mesh instances
|
|
|
|
with_dict: "{{ meshes }}"
|
|
|
|
|
|
|
|
- name: set file attributes for peer_limit.conf
|
|
|
|
file:
|
|
|
|
path: "/etc/fastd/{{ item.key }}VPN/peer_limit.conf"
|
|
|
|
mode: 0640
|
|
|
|
owner: admin
|
|
|
|
group: admin
|
|
|
|
notify: restart fastd mesh instances
|
|
|
|
with_dict: "{{ meshes }}"
|
|
|
|
|
2017-10-03 23:30:02 +02:00
|
|
|
- name: write systemd unit fastd-sync-meshkeys.service
|
|
|
|
template:
|
|
|
|
src: fastd-sync-meshkeys.service.j2
|
|
|
|
dest: /etc/systemd/system/fastd-sync-meshkeys.service
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: reload systemd
|
|
|
|
|
|
|
|
- name: write systemd timer fastd-sync-meshkeys.timer
|
|
|
|
template:
|
|
|
|
src: fastd-sync-meshkeys.timer.j2
|
|
|
|
dest: /etc/systemd/system/fastd-sync-meshkeys.timer
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: reload systemd
|
|
|
|
|
|
|
|
- name: configure systemd unit/timer fastd-sync-meshkeys
|
|
|
|
systemd:
|
|
|
|
name: fastd-sync-meshkeys.timer
|
|
|
|
enabled: yes
|
|
|
|
state: started
|