3
0
Fork 0

Delete locally stored private key

This commit is contained in:
Frédéric Bourqui 2019-10-18 18:40:47 +02:00
parent 74312aecd2
commit 785b2ba8a4
1 changed files with 17 additions and 1 deletions

View File

@ -125,9 +125,25 @@
- wg-config
notify:
- restart wireguard
- name: Start and enable WireGuard service
service:
name: "wg-quick@{{ wireguard_interface }}"
state: started
enabled: yes
- name: Look for local private key
find:
paths: "{{ wireguard_cert_directory }}"
patterns: "*.private.key"
register: local_private_key_to_delete
delegate_to: localhost
run_once: true
- name: Delete local private key
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ local_private_key_to_delete.files }}"
delegate_to: localhost
run_once: true