infra-ansible
ansible script to ship alpine/ssh/wireguard
git clone https://9o.is/git/infra-ansible.git
commit 0cc5d4e21c8d272818d23bf5bf4b94ed13f0264c parent 4bd7db45c385b736058065afad94c1b78ae7c6e2 Author: Jul <jul@9o.is> Date: Wed, 15 May 2024 15:11:24 +0800 persist /etc/hosts changes in qubes Diffstat:
| M | host/roles/wireguard/tasks/client.yml | | | 24 | ++++++++++++++++++++++++ |
1 file changed, 24 insertions(+), 0 deletions(-)
diff --git a/host/roles/wireguard/tasks/client.yml b/host/roles/wireguard/tasks/client.yml @@ -81,3 +81,27 @@ group: root mode: '0644' +- name: persist /etc/hosts for qubes + delegate_to: localhost + delegate_facts: true + block: + - name: add {{ wg_server_ip }} to /rw/config/hosts + lineinfile: + path: /rw/config/hosts + create: true + search_string: '{{ wg_server_ip }}' + line: '{{ wg_server_ip }} {{ ansible_nodename }}' + owner: root + group: root + mode: '0644' + - name: create rc.local script + copy: + dest: /rw/config/rc.local.d/hosts.rc + owner: root + group: root + mode: '0755' + content: | + #!/bin/sh + cat /rw/config/hosts >> /etc/hosts + +