File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
roles/vpn-wireguard/tasks Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 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
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) }}
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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'
You can’t perform that action at this time.
0 commit comments