ansible-ffibk/roles/service-fastd-intragate/tasks/main.yml
Tobias Hachmer 53d30c8ded Restructure fastd configuration to define multiple instances easily
- introduce mesh subdictionary `fastd`
 - change fastd instance naming
 - change fastd network interface naming (identical with fastd instance
names)
 - change mac address prefixes
2017-10-07 00:57:35 +02:00

57 lines
1.5 KiB
YAML

---
- name: configure systemd unit fastd@
systemd:
name: "fastd@{{ item.0.id }}igVPN-{{ item.1.mtu }}"
enabled: yes
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances
- name: create fastd intragate directories
file:
path: "/etc/fastd/{{ item.0.id }}igVPN-{{ item.1.mtu }}"
state: directory
mode: 0755
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances
- name: create fastd peer intragate directories
file:
path: "/etc/fastd/{{ item.0.id }}igVPN-{{ item.1.mtu }}/peers"
state: directory
mode: 0755
owner: admin
group: admin
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances
- name: clone fastd peer intragate repos
git:
repo: "{{ item.1.peers.repo }}"
dest: "/etc/fastd/{{ item.0.id }}igVPN-{{ item.1.mtu }}/peers"
version: "{{ item.1.peers.version }}"
update: no
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances
become: false
- name: template fastd mesh config
template:
src: fastd-intragate.conf.j2
dest: "/etc/fastd/{{ item.0.id }}igVPN-{{ item.1.mtu }}/fastd.conf"
notify: restart fastd intragate instances
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances
- name: write fastd intragate secret
template:
src: fastd-secret.conf.j2
dest: "/etc/fastd/{{ item.0.id }}igVPN-{{ item.1.mtu }}/secret.conf"
notify: restart fastd intragate instances
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances