Add Hosts to each others /etc/hosts file
This commit is contained in:
parent
8899e1e06b
commit
6c48dc25d4
@ -47,6 +47,14 @@
|
|||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: wg-quick@wg_infra
|
name: wg-quick@wg_infra
|
||||||
enabled: true
|
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:
|
handlers:
|
||||||
- name: Restart wireguard
|
- name: Restart wireguard
|
||||||
|
Loading…
Reference in New Issue
Block a user