update mesh
This commit is contained in:
28
mesh/keys.yaml
Normal file
28
mesh/keys.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
- name: Update nginx stream configuration
|
||||
hosts:
|
||||
- colors
|
||||
- kubernetes
|
||||
- truenas
|
||||
- nextcloud-aio
|
||||
- unifi-external
|
||||
become: true
|
||||
become_user: root
|
||||
become_method: sudo
|
||||
tasks:
|
||||
- name: Ensure wireguard directory exists
|
||||
ansible.builtin.file:
|
||||
path: /etc/wireguard
|
||||
state: directory
|
||||
mode: '0700'
|
||||
- name: Check if privatekey exists
|
||||
stat: path=/etc/wireguard/privatekey
|
||||
register: key
|
||||
- name: Generate pubkey and privatekey
|
||||
shell: wg genkey | tee /etc/wireguard/privatekey | wg pubkey > /etc/wireguard/publickey
|
||||
when: not key.stat.exists or key.stat.size == 0
|
||||
- name: cat pubkey
|
||||
command: cat /etc/wireguard/publickey
|
||||
register: pubkey
|
||||
- name: Print publickey to console
|
||||
debug:
|
||||
msg: "{{pubkey.stdout}}"
|
||||
Reference in New Issue
Block a user