Show reminder when key generated
This commit is contained in:
parent
768c54b227
commit
34f33e820d
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
shell: umask 077 && wg genkey | tee /etc/wireguard/privatekey | wg pubkey > /etc/wireguard/publickey
|
shell: umask 077 && wg genkey | tee /etc/wireguard/privatekey | wg pubkey > /etc/wireguard/publickey
|
||||||
args:
|
args:
|
||||||
creates: /etc/wireguard/publickey
|
creates: /etc/wireguard/publickey
|
||||||
|
register: key_generation
|
||||||
notify:
|
notify:
|
||||||
- Restart Wireguard service
|
- Restart Wireguard service
|
||||||
|
|
||||||
|
@ -24,7 +25,6 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
public_key: "{{ public_key_slurp.content | b64decode }}"
|
public_key: "{{ public_key_slurp.content | b64decode }}"
|
||||||
|
|
||||||
|
|
||||||
- name: Ensure Wireguard client is configured
|
- name: Ensure Wireguard client is configured
|
||||||
template:
|
template:
|
||||||
src: templates/wireguard_client.conf
|
src: templates/wireguard_client.conf
|
||||||
|
@ -43,6 +43,7 @@
|
||||||
- name: Show public key reminder
|
- name: Show public key reminder
|
||||||
debug:
|
debug:
|
||||||
msg: "Remember to add this host '{{ inventory_hostname }}'' public key to the inventory '{{ public_key }}'"
|
msg: "Remember to add this host '{{ inventory_hostname }}'' public key to the inventory '{{ public_key }}'"
|
||||||
|
when: key_generation.changed
|
||||||
|
|
||||||
- name: Ensure cron to ping VPN server exists
|
- name: Ensure cron to ping VPN server exists
|
||||||
cron:
|
cron:
|
||||||
|
|
Loading…
Reference in a new issue