Change task Generate and save private keys

This commit is contained in:
2026-08-29 23:10:38 +03:00
parent 25887f3bcf
commit bcf0c9e47e

View File

@@ -8,15 +8,15 @@
loop_control:
label: "{{ item.name }}"
- name: "Generate and save private key"
- name: "Generate and save peer private keys"
ansible.builtin.shell: |
wg genkey > {{ wireguard_client_config_dir }}/peer_{{ item.name }}_private.key
chmod 0600 {{ wireguard_client_config_dir }}/peer_{{ item.name }}_private.key
wg genkey > {{ wireguard_config_dir }}/peer_{{ item.item.name }}_private.key
chmod 0600 {{ wireguard_config_dir }}/peer_{{ item.item.name }}_private.key
loop: "{{ peer_key_stat.results }}"
loop_control:
label: "{{ item.item.name }}"
when: not item.stat.exists
# no_log: true
no_log: false
- name: "Read all private keys"
ansible.builtin.slurp: