ansible-ffibk/roles/service-fastd-intragate/tasks/main.yml

59 lines
1.5 KiB
YAML
Raw Normal View History

---
- name: create fastd intragate directories
file:
2017-11-06 21:24:56 +01:00
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:
2017-11-06 21:24:56 +01:00
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 }}"
2017-11-06 21:24:56 +01:00
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
2017-11-06 21:24:56 +01:00
dest: "/etc/fastd/{{ item.0.id }}igvpn-{{ item.1.mtu }}/fastd.conf"
notify: restart fastd intragate instances
with_subelements:
2017-10-26 22:29:15 +02:00
- "{{ meshes }}"
- fastd.intragate.instances
- name: write fastd intragate secret
template:
src: fastd-secret.conf.j2
2017-11-06 21:24:56 +01:00
dest: "/etc/fastd/{{ item.0.id }}igvpn-{{ item.1.mtu }}/secret.conf"
notify: restart fastd intragate instances
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances
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 }}igvpn-{{ item.1.mtu }}"
2017-10-26 22:35:55 +02:00
enabled: yes
state: started
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances