aboutsummaryrefslogtreecommitdiffstats
path: root/roles/workstation/templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/workstation/templates')
-rw-r--r--roles/workstation/templates/ssh.config.j211
1 files changed, 11 insertions, 0 deletions
diff --git a/roles/workstation/templates/ssh.config.j2 b/roles/workstation/templates/ssh.config.j2
new file mode 100644
index 0000000..2915a1a
--- /dev/null
+++ b/roles/workstation/templates/ssh.config.j2
@@ -0,0 +1,11 @@
+# managed by Ansible
+{% import 'macros.j2' as macros with context %}
+
+{% call(h) macros.loop_valid_hosts("all") %}
+{% set command = "pgrep wg && ! ping -c 1 -w 1 %s" % h.__ip.external %}
+Match originalHost {{ h.inventory_hostname }} exec "{{ command }}"
+ HostName {{ h.__ip.internal }}
+Match originalHost {{ h.inventory_hostname }}
+ HostName {{ h.__ip.external }}
+
+{% endcall %}
remember that computers suck.