Delete locally stored private key
This commit is contained in:
parent
74312aecd2
commit
785b2ba8a4
|
@ -131,3 +131,19 @@
|
||||||
name: "wg-quick@{{ wireguard_interface }}"
|
name: "wg-quick@{{ wireguard_interface }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
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
|
||||||
|
|
Reference in a new issue