2017-09-05 12:01:27 +02:00
|
|
|
---
|
|
|
|
- name: create fastd directories
|
|
|
|
file:
|
2017-11-06 21:24:56 +01:00
|
|
|
path: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}"
|
2017-09-05 12:01:27 +02:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
2017-10-07 00:57:35 +02:00
|
|
|
with_subelements:
|
|
|
|
- "{{ meshes }}"
|
|
|
|
- fastd.nodes.instances
|
2017-09-05 12:01:27 +02:00
|
|
|
|
2017-10-03 20:25:17 +02:00
|
|
|
- name: create fastd peer mesh directories
|
|
|
|
file:
|
2017-11-06 21:24:56 +01:00
|
|
|
path: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}/peers"
|
2017-10-03 20:25:17 +02:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
owner: admin
|
|
|
|
group: admin
|
2017-10-07 00:57:35 +02:00
|
|
|
with_subelements:
|
|
|
|
- "{{ meshes }}"
|
|
|
|
- fastd.nodes.instances
|
2017-10-03 20:25:17 +02:00
|
|
|
|
|
|
|
- name: create fastd peer mesh directories for ffbin
|
|
|
|
file:
|
2017-11-06 21:24:56 +01:00
|
|
|
path: "/etc/fastd/mzvpn-{{ item }}/peers_bingen"
|
2017-10-03 20:25:17 +02:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
owner: admin
|
|
|
|
group: admin
|
2017-10-07 00:57:35 +02:00
|
|
|
with_items:
|
|
|
|
- 1406
|
|
|
|
- 1312
|
2017-10-03 20:25:17 +02:00
|
|
|
|
|
|
|
- name: clone fastd peer mesh repos
|
|
|
|
git:
|
2017-10-07 00:57:35 +02:00
|
|
|
repo: "{{ item.1.peers.repo }}"
|
2017-11-06 21:24:56 +01:00
|
|
|
dest: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}/peers"
|
2017-10-07 00:57:35 +02:00
|
|
|
version: "{{ item.1.peers.version }}"
|
2017-10-03 20:25:17 +02:00
|
|
|
update: no
|
2017-10-07 00:57:35 +02:00
|
|
|
with_subelements:
|
|
|
|
- "{{ meshes }}"
|
|
|
|
- fastd.nodes.instances
|
2017-10-03 20:25:17 +02:00
|
|
|
become: false
|
|
|
|
|
|
|
|
- name: clone fastd peer mesh repo for ffbin
|
|
|
|
git:
|
|
|
|
repo: https://github.com/freifunk-bingen/peers-ffbin.git
|
2017-11-06 21:24:56 +01:00
|
|
|
dest: "/etc/fastd/mzvpn-{{ item }}/peers_bingen"
|
2017-10-03 20:25:17 +02:00
|
|
|
version: master
|
|
|
|
update: no
|
2017-10-07 00:57:35 +02:00
|
|
|
with_items:
|
|
|
|
- 1406
|
|
|
|
- 1312
|
2017-10-03 20:25:17 +02:00
|
|
|
become: false
|
|
|
|
|
2017-09-05 12:01:27 +02:00
|
|
|
- name: template fastd mesh config
|
|
|
|
template:
|
|
|
|
src: fastd-mesh.conf.j2
|
2017-11-06 21:24:56 +01:00
|
|
|
dest: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}/fastd.conf"
|
2017-10-03 20:25:17 +02:00
|
|
|
notify: restart fastd mesh instances
|
2017-10-07 00:57:35 +02:00
|
|
|
with_subelements:
|
|
|
|
- "{{ meshes }}"
|
|
|
|
- fastd.nodes.instances
|
2017-09-05 12:01:27 +02:00
|
|
|
|
|
|
|
- name: write fastd mesh secret
|
|
|
|
template:
|
|
|
|
src: fastd-secret.conf.j2
|
2017-11-06 21:24:56 +01:00
|
|
|
dest: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}/secret.conf"
|
2017-10-03 20:25:17 +02:00
|
|
|
notify: restart fastd mesh instances
|
2017-10-07 00:57:35 +02:00
|
|
|
with_subelements:
|
|
|
|
- "{{ meshes }}"
|
|
|
|
- fastd.nodes.instances
|
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
|
2017-11-06 21:24:56 +01:00
|
|
|
dest: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}/peer_limit.conf"
|
2017-10-06 10:33:38 +02:00
|
|
|
owner: admin
|
|
|
|
group: admin
|
|
|
|
mode: 0640
|
|
|
|
force: no
|
|
|
|
notify: restart fastd mesh instances
|
2017-10-07 00:57:35 +02:00
|
|
|
with_subelements:
|
|
|
|
- "{{ meshes }}"
|
|
|
|
- fastd.nodes.instances
|
2017-10-06 10:33:38 +02:00
|
|
|
|
|
|
|
- name: set file attributes for peer_limit.conf
|
|
|
|
file:
|
2017-11-06 21:24:56 +01:00
|
|
|
path: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}/peer_limit.conf"
|
2017-10-06 10:33:38 +02:00
|
|
|
mode: 0640
|
|
|
|
owner: admin
|
|
|
|
group: admin
|
|
|
|
notify: restart fastd mesh instances
|
2017-10-07 00:57:35 +02:00
|
|
|
with_subelements:
|
|
|
|
- "{{ meshes }}"
|
|
|
|
- fastd.nodes.instances
|
2017-10-06 10:33:38 +02:00
|
|
|
|
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
|
|
|
|
|
2017-11-30 23:12:15 +01:00
|
|
|
- name: create fastd_status.json file
|
|
|
|
file:
|
|
|
|
path: /var/www/html/fastd_status.json
|
|
|
|
state: touch
|
|
|
|
owner: admin
|
|
|
|
group: admin
|
|
|
|
mode: 0644
|
|
|
|
|
2017-11-06 17:41:17 +01:00
|
|
|
- name: write configuration for fastd-peer-limit-update script
|
|
|
|
template:
|
|
|
|
src: fastd_peer_limit_config.yaml.j2
|
2017-12-31 13:41:15 +01:00
|
|
|
dest: /home/admin/.ffmwu-config/fastd_peer_limit_config.yaml
|
2017-11-06 17:41:17 +01:00
|
|
|
owner: admin
|
|
|
|
group: admin
|
|
|
|
mode: 0644
|
|
|
|
|
2017-10-06 11:47:09 +02:00
|
|
|
- name: write systemd unit fastd-peer-limit-update.service
|
|
|
|
template:
|
|
|
|
src: fastd-peer-limit-update.service.j2
|
|
|
|
dest: /etc/systemd/system/fastd-peer-limit-update.service
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: reload systemd
|
|
|
|
|
|
|
|
- name: write systemd timer fastd-peer-limit-update.timer
|
|
|
|
template:
|
|
|
|
src: fastd-peer-limit-update.timer.j2
|
|
|
|
dest: /etc/systemd/system/fastd-peer-limit-update.timer
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: reload systemd
|
|
|
|
|
|
|
|
- name: configure systemd timers for fastd-mesh instance
|
2017-10-03 23:30:02 +02:00
|
|
|
systemd:
|
2017-10-06 11:47:09 +02:00
|
|
|
name: "{{ item }}.timer"
|
2017-10-03 23:30:02 +02:00
|
|
|
enabled: yes
|
|
|
|
state: started
|
2017-10-06 11:47:09 +02:00
|
|
|
with_items:
|
|
|
|
- fastd-sync-meshkeys
|
|
|
|
- fastd-peer-limit-update
|
2017-10-26 22:35:55 +02:00
|
|
|
|
|
|
|
- name: configure systemd unit fastd@
|
|
|
|
systemd:
|
2017-11-06 21:24:56 +01:00
|
|
|
name: "fastd@{{ item.0.id }}vpn-{{ item.1.mtu }}"
|
2017-10-26 22:35:55 +02:00
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
with_subelements:
|
|
|
|
- "{{ meshes }}"
|
|
|
|
- fastd.nodes.instances
|