2023-01-03 11:22:26 +01:00
|
|
|
- name: Download new peers file from remote url
|
|
|
|
ansible.builtin.get_url:
|
|
|
|
url: "{{yggdrasil_peers_list_url}}"
|
|
|
|
dest: /tmp/yggdrasil_peers.conf
|
|
|
|
mode: '0500'
|
|
|
|
force: true
|
|
|
|
|
|
|
|
- name: Get peers from remote file list
|
|
|
|
ansible.builtin.slurp:
|
|
|
|
src: "/tmp/yggdrasil_peers.conf"
|
|
|
|
register: yggdrasil_peers_encoded
|
|
|
|
|
|
|
|
- name: Decode remote peers content
|
|
|
|
set_fact:
|
|
|
|
yggdrasil_peers: "{{yggdrasil_peers_encoded.content | b64decode}}"
|
|
|
|
|
2022-12-27 20:37:22 +01:00
|
|
|
- name: Update yggdrasil.conf with peers
|
|
|
|
replace:
|
|
|
|
path: /etc/yggdrasil.conf
|
|
|
|
regexp: '\bPeers:\s*((?:(?!\bPeers\b).|\n)+?)\](?!:)'
|
2023-01-03 11:22:26 +01:00
|
|
|
replace: "{{yggdrasil_peers}}"
|