Skip to content

Commit a3bbb10

Browse files
committed
vpn-wireguard: use fqdn for backup and restore tasks
1 parent 7d893fb commit a3bbb10

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

roles/vpn-wireguard/tasks/backup/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
tags: backup
1515

1616
- name: Store the keys
17-
set_fact:
17+
ansible.builtin.set_fact:
1818
private_key: '{{ private_key_slurp["content"] | b64decode }}'
1919
public_key: '{{ public_key_slurp["content"] | b64decode }}'
2020
tags: backup
@@ -24,12 +24,12 @@
2424
block:
2525
- name: Store the private key
2626
no_log: '{{ hide_secrets }}'
27-
set_fact:
27+
ansible.builtin.set_fact:
2828
_: >-
2929
{{ lookup(creds.store, creds.prefix + "/wireguard/private-key",
3030
create=true, missing="create", userpass=private_key) }}
3131
- name: Store the public key
32-
set_fact:
32+
ansible.builtin.set_fact:
3333
_: >-
3434
{{ lookup(creds.store, creds.prefix + "/wireguard/public-key",
3535
create=true, missing="create", userpass=public_key) }}

roles/vpn-wireguard/tasks/check/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
- name: Check that wireguard is working
44
no_log: '{{ hide_secrets }}'
5-
shell: wg showconf wg0
5+
ansible.builtin.shell: wg showconf wg0
66
changed_when: false

roles/vpn-wireguard/tasks/restore/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
---
22

33
- name: load the public key from the credentials store
4-
set_fact:
4+
ansible.builtin.set_fact:
55
public_key: >-
66
{{ lookup(creds.store, creds.prefix + "/wireguard/public-key") }}
77
tags: restore
88

99
- name: load the private key from the credentials store
1010
no_log: '{{ hide_secrets }}'
11-
set_fact:
11+
ansible.builtin.set_fact:
1212
private_key: >-
1313
{{ lookup(creds.store, creds.prefix + "/wireguard/private-key") }}
1414
tags: restore
1515

1616
- name: Restore the public key
17-
copy:
17+
ansible.builtin.copy:
1818
content: '{{ public_key }}'
1919
dest: /etc/wireguard/public-key
2020
mode: '0644'
2121
tags: restore
2222

2323
- name: Restore the private key
2424
no_log: '{{ hide_secrets }}'
25-
copy:
25+
ansible.builtin.copy:
2626
content: '{{ private_key }}'
2727
dest: /etc/wireguard/private-key
2828
mode: '0600'

0 commit comments

Comments
 (0)