aboutsummaryrefslogtreecommitdiffstats
path: root/roles/workstation
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-30 15:39:08 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-30 15:50:40 +0000
commit6b106cce38106e7beb9db623a9d98784cb8bbc86 (patch)
treea7ec7381526c44dd778ab3a911e55b654c1746eb /roles/workstation
parentd39f2e2ac88b107014c373b380eb76adae0f91ee (diff)
downloadrules-6b106cce38106e7beb9db623a9d98784cb8bbc86.tar.gz
ansible_port: Add ssh port switch to network roles
Diffstat (limited to 'roles/workstation')
-rw-r--r--roles/workstation/templates/ssh.config.j26
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/workstation/templates/ssh.config.j2 b/roles/workstation/templates/ssh.config.j2
index 2915a1a..2a3a903 100644
--- a/roles/workstation/templates/ssh.config.j2
+++ b/roles/workstation/templates/ssh.config.j2
@@ -5,7 +5,13 @@
{% set command = "pgrep wg && ! ping -c 1 -w 1 %s" % h.__ip.external %}
Match originalHost {{ h.inventory_hostname }} exec "{{ command }}"
HostName {{ h.__ip.internal }}
+{% if h.ansible_port is defined %}
+ Port {{ h.ansible_port }}
+{% endif %}
Match originalHost {{ h.inventory_hostname }}
HostName {{ h.__ip.external }}
+{% if h.ansible_port is defined %}
+ Port {{ h.ansible_port }}
+{% endif %}
{% endcall %}
remember that computers suck.