fix(wg): correct check for existing private key
Registering output of ‹ansible.builtin.stat› generates an object containing ‹stat› member itself. Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
4960068555
commit
ab5c374990
1 changed files with 4 additions and 4 deletions
|
@ -6,11 +6,11 @@
|
||||||
- name: Check for existence of private key
|
- name: Check for existence of private key
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /etc/wireguard/private.key
|
path: /etc/wireguard/private.key
|
||||||
register: _private_key_stat
|
register: _private_key
|
||||||
|
|
||||||
- name: Generate keypair
|
- name: Generate keypair
|
||||||
ansible.builtin.include_tasks: tasks/generate_keypair.yml
|
ansible.builtin.include_tasks: tasks/generate_keypair.yml
|
||||||
when: not _private_key_stat.exists
|
when: not _private_key.stat.exists
|
||||||
|
|
||||||
- name: Save private key
|
- name: Save private key
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
mode: 0700
|
mode: 0700
|
||||||
vars:
|
vars:
|
||||||
key: "{{ wg_private_key }}"
|
key: "{{ wg_private_key }}"
|
||||||
when: not _private_key_stat.exists
|
when: not _private_key.stat.exists
|
||||||
|
|
||||||
- name: Save public key
|
- name: Save public key
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
mode: 0700
|
mode: 0700
|
||||||
vars:
|
vars:
|
||||||
key: "{{ wg_public_key }}"
|
key: "{{ wg_public_key }}"
|
||||||
when: not _private_key_stat.exists
|
when: not _private_key.stat.exists
|
||||||
|
|
||||||
- name: Set dns_command for co-openSUSE
|
- name: Set dns_command for co-openSUSE
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
|
Loading…
Reference in a new issue