diff --git a/coreos-config/plays/vpn.yaml b/coreos-config/plays/vpn.yaml index d08a411..5a43a3b 100644 --- a/coreos-config/plays/vpn.yaml +++ b/coreos-config/plays/vpn.yaml @@ -47,6 +47,14 @@ ansible.builtin.systemd: name: wg-quick@wg_infra enabled: true + - name: Setup /etc/hosts + ansible.builtin.lineinfile: + path: /etc/hosts + regexp: "^{{ item }}\\s" + line: "{{ hostvars[item]['wg_addr'] | mandatory }} {{ item }}" + state: present + loop: "{{ nodes }}" + when: item != inventory_hostname handlers: - name: Restart wireguard