summaryrefslogtreecommitdiff
path: root/j2
diff options
context:
space:
mode:
Diffstat (limited to 'j2')
-rw-r--r--j2/wireguard/ansible-host.j25
-rw-r--r--j2/wireguard/inventory.j25
2 files changed, 10 insertions, 0 deletions
diff --git a/j2/wireguard/ansible-host.j2 b/j2/wireguard/ansible-host.j2
index 63a8d51..72273ef 100644
--- a/j2/wireguard/ansible-host.j2
+++ b/j2/wireguard/ansible-host.j2
@@ -1,3 +1,8 @@
# Generated
link_address: {{ link }}
network_cidr: {{ network }}
+wireguard_peers:
+ {{ host.name }}:
+{%- for peer in peers %}
+ - {{ peer }}
+{%- endfor %}
diff --git a/j2/wireguard/inventory.j2 b/j2/wireguard/inventory.j2
new file mode 100644
index 0000000..c7f38ee
--- /dev/null
+++ b/j2/wireguard/inventory.j2
@@ -0,0 +1,5 @@
+# Generated
+all:
+{%- for host in hosts %}
+ {{ host.name }}: {{ host.fqdn }}
+{%- endfor %}