travel router
This commit is contained in:
1 parent
d1ea7aaff2
commit
2658d7403d
10 files changed
+134
-12
No files matched your search
+13
-5
@@ -219,15 +219,23 @@
|
||||
ansible.builtin.debug:
|
||||
msg: "RackNerd WG public key: {{ wg_pubkey.stdout }}"
|
||||
|
||||
- name: Deploy wg0.conf (rendered from host/wg0.conf.example)
|
||||
- name: Deploy wg0.conf (rendered from host/wg0.conf.example + travel peers)
|
||||
tags: [host, wireguard]
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/wireguard/wg0.conf
|
||||
mode: "0600"
|
||||
content: "{{ lookup('file', playbook_dir ~ '/../host/wg0.conf.example')
|
||||
| replace('<RACKNERD_WG_PRIVATE_KEY>', wg_key_raw.content | b64decode | trim)
|
||||
| replace('<TROCHALAKIS_WG_PUBLIC_KEY>', troch_wg_public_key | default('<TROCHALAKIS_WG_PUBLIC_KEY>', true))
|
||||
| replace('<OSWALD_WG_PUBLIC_KEY>', oswald_wg_public_key | default('<OSWALD_WG_PUBLIC_KEY>', true)) }}\n"
|
||||
content: |
|
||||
{{ lookup('file', playbook_dir ~ '/../host/wg0.conf.example')
|
||||
| replace('<RACKNERD_WG_PRIVATE_KEY>', wg_key_raw.content | b64decode | trim)
|
||||
| replace('<TROCHALAKIS_WG_PUBLIC_KEY>', troch_wg_public_key | default('<TROCHALAKIS_WG_PUBLIC_KEY>', true))
|
||||
| replace('<OSWALD_WG_PUBLIC_KEY>', oswald_wg_public_key | default('<OSWALD_WG_PUBLIC_KEY>', true)) }}
|
||||
{% for p in wg_travel_peers | default([]) %}
|
||||
|
||||
# ── Travel router: {{ p.name }} (roaming /32, appended by Ansible) ──
|
||||
[Peer]
|
||||
PublicKey = {{ p.public_key }}
|
||||
AllowedIPs = {{ p.ip }}/32
|
||||
{% endfor %}
|
||||
no_log: true
|
||||
notify: restart wireguard
|
||||
|
||||
|
||||
Reference in new issue
Block a user