summaryrefslogtreecommitdiff
path: root/module/ri-wireguard/src/main/resources/templates
diff options
context:
space:
mode:
Diffstat (limited to 'module/ri-wireguard/src/main/resources/templates')
-rw-r--r--module/ri-wireguard/src/main/resources/templates/wireguard/ansible-host.j27
-rw-r--r--module/ri-wireguard/src/main/resources/templates/wireguard/ansible.j29
2 files changed, 11 insertions, 5 deletions
diff --git a/module/ri-wireguard/src/main/resources/templates/wireguard/ansible-host.j2 b/module/ri-wireguard/src/main/resources/templates/wireguard/ansible-host.j2
index cbf707e..6cb3a05 100644
--- a/module/ri-wireguard/src/main/resources/templates/wireguard/ansible-host.j2
+++ b/module/ri-wireguard/src/main/resources/templates/wireguard/ansible-host.j2
@@ -1,7 +1,12 @@
# Generated
+wireguard_port: {{ host.publicPort }}
link_address: {{ host.ip }}
network_cidr: {{ host.networkCidr }}
wireguard_peers:
{%- for peer in peers %}
- - {{ peer.fqdn }}
+ {{ peer.machine.name }}:
+ public_address: {{ peer.publicName }}
+ public_port: {{ peer.publicPort }}
+ gateway: {{ peer.ip }}
+ network: {{ peer.networkCidr }}
{%- endfor %}
diff --git a/module/ri-wireguard/src/main/resources/templates/wireguard/ansible.j2 b/module/ri-wireguard/src/main/resources/templates/wireguard/ansible.j2
index bca3e8c..ad4d034 100644
--- a/module/ri-wireguard/src/main/resources/templates/wireguard/ansible.j2
+++ b/module/ri-wireguard/src/main/resources/templates/wireguard/ansible.j2
@@ -1,6 +1,7 @@
- hosts: wireguard_{{ net.name }}
- roles:
+ vars:
+ wireguard_if: {{ net.name }}
+ tasks:
- name: wireguard
- wireguard_if: {{ net.name }}
- wireguard_listen_port: 45364
- wireguard_address4: "{{ '{{' }} link_address }}"
+ import_role:
+ name: wireguard