summaryrefslogtreecommitdiff
path: root/j2/wireguard
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-01-12 23:06:32 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-01-12 23:06:32 +0100
commite2f4aefa956bb06b1ee52d95ad8275757605678d (patch)
treeed4810a3ced1b49adf09d171cefc37eb7b5c3e51 /j2/wireguard
parent0e8048146ddf85adf28c1da09e45b98760f23210 (diff)
downloadrules-sandbox-e2f4aefa956bb06b1ee52d95ad8275757605678d.tar.gz
rules-sandbox-e2f4aefa956bb06b1ee52d95ad8275757605678d.tar.bz2
rules-sandbox-e2f4aefa956bb06b1ee52d95ad8275757605678d.tar.xz
rules-sandbox-e2f4aefa956bb06b1ee52d95ad8275757605678d.zip
Switching WG code to use object references.
Diffstat (limited to 'j2/wireguard')
-rw-r--r--j2/wireguard/ansible-host.j24
-rw-r--r--j2/wireguard/inventory.j28
2 files changed, 7 insertions, 5 deletions
diff --git a/j2/wireguard/ansible-host.j2 b/j2/wireguard/ansible-host.j2
index 9d684ef..a3c8c40 100644
--- a/j2/wireguard/ansible-host.j2
+++ b/j2/wireguard/ansible-host.j2
@@ -2,7 +2,7 @@
link_address: {{ host.ip }}
network_cidr: {{ host.networkCidr }}
wireguard_peers:
- {{ host.name }}:
+ {{ host.machine.name }}:
{%- for peer in peers %}
- - {{ peer }}
+ - {{ peer.fqdn }}
{%- endfor %}
diff --git a/j2/wireguard/inventory.j2 b/j2/wireguard/inventory.j2
index c7f38ee..0924bb2 100644
--- a/j2/wireguard/inventory.j2
+++ b/j2/wireguard/inventory.j2
@@ -1,5 +1,7 @@
# Generated
all:
-{%- for host in hosts %}
- {{ host.name }}: {{ host.fqdn }}
-{%- endfor %}
+ hosts:
+ {%- for host in hosts %}
+ {{ host.getName() }}:
+ ansible_host: {{ host.getFqdn() }}
+ {%- endfor %}