Added role wireguard/special_client
parent
96ae42477f
commit
d3f2e8d4b5
@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
# hostname: example.com
|
||||
client_private_key: "{{ global_wireguard_private_directory }}/{{ hostname }}"
|
||||
client_public_key: "{{ global_wireguard_public_directory }}/{{ hostname }}"
|
@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Generate private key
|
||||
command: >-
|
||||
/bin/sh -c "/usr/bin/wg genkey > {{ wireguard_client_private_key | quote }}"
|
||||
args:
|
||||
creates: "{{ wireguard_client_private_key }}"
|
||||
register: wireguard_private_key
|
||||
delegate_to: 127.0.0.1
|
||||
|
||||
- name: Generate public key
|
||||
command: >-
|
||||
/bin/sh -c "< {{ client_public_key | quote }} /usr/bin/wg pubkey > {{ wireguard_client_private_key | quote }}"
|
||||
when: wireguard_private_key.changed
|
||||
delegate_to: 127.0.0.1
|
Loading…
Reference in New Issue