aboutsummaryrefslogtreecommitdiffstats
path: root/roles/ssh/templates
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-11-03 23:25:59 +0100
committerbinary <me@rgoncalves.se>2020-11-03 23:25:59 +0100
commitc428dacb8eb7af00c5c8aafa805502feb1b0625c (patch)
tree47489aa56731f51c7deea50e1bd78e7d242ef9e9 /roles/ssh/templates
parentaf78a2b68e25296ecf2187199bb9e3b2ed370e46 (diff)
downloadinfrastructure-c428dacb8eb7af00c5c8aafa805502feb1b0625c.tar.gz
Init ssh role
Diffstat (limited to 'roles/ssh/templates')
-rw-r--r--roles/ssh/templates/generate_dns.j213
1 files changed, 13 insertions, 0 deletions
diff --git a/roles/ssh/templates/generate_dns.j2 b/roles/ssh/templates/generate_dns.j2
new file mode 100644
index 0000000..c8d5a44
--- /dev/null
+++ b/roles/ssh/templates/generate_dns.j2
@@ -0,0 +1,13 @@
+{% for host in groups["servers"] %}
+{% set host = hostvars[host] %}
+
+Match originalhost dcontroller exec "systemctl is-active wg-quick@{{ _i.dcontroller }}.service"
+ HostName {{ host.ip.inbound }}
+ Port {{ host.services.tcp.ssh }}
+
+Match originalhost {{ host.ansible_host }}
+ HostName {{ host.ip.outbound }}
+ Port {{ host.services.tcp.ssh }}
+ User root
+
+{% endfor %}
remember that computers suck.