Cleanup fetched tinc certificates

This commit is contained in:
Paul-Henri Froidmont 2019-08-16 17:11:52 +02:00
parent 6ad25c79f6
commit 30b83f9067

View file

@ -93,21 +93,31 @@
notify: notify:
- restart tinc - restart tinc
- name: Fetch tinc hosts file after key creation - block:
fetch: - name: Fetch tinc hosts file after key creation
src: /etc/tinc/{{ netname }}/hosts/{{ inventory_hostname }} fetch:
dest: fetch/{{ inventory_hostname }} src: /etc/tinc/{{ netname }}/hosts/{{ inventory_hostname }}
flat: yes dest: fetch/{{ inventory_hostname }}
notify: flat: yes
- reload tinc changed_when: false
- name: Sync the fetched tinc hosts files on each host
synchronize:
src: fetch/
dest: /etc/tinc/{{ netname }}/hosts/
use_ssh_args: yes
notify:
- reload tinc
always:
- name: Remove fetched files
local_action:
module: file
path: fetch
state: absent
run_once: True
changed_when: false
- name: Sync the fetched tinc hosts files on each host
synchronize:
src: fetch/
dest: /etc/tinc/{{ netname }}/hosts/
use_ssh_args: yes
notify:
- reload tinc
- meta: flush_handlers - meta: flush_handlers