summaryrefslogtreecommitdiffstats
path: root/roles/static_inventory/templates/ssh-tunnel.service.j2
blob: 0d1cf8f794d1dc5353b32be4282093799ec39fe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[Unit]
Description=Set up ssh tunneling for OpenShift cluster UI
After=network.target

[Service]
ExecStart=/usr/bin/ssh -NT -o \
   ServerAliveInterval=60 -o \
   UserKnownHostsFile=/dev/null -o \
   StrictHostKeyChecking=no -o \
   ExitOnForwardFailure=no -i \
   {{ private_ssh_key }} {{ ssh_user }}@{{ hostvars['bastion'].ansible_host }} \
   -L 0.0.0.0:{{ ui_port }}:{{ target_ip }}:{{ ui_port }}


# Restart every >2 seconds to avoid StartLimitInterval failure
RestartSec=5
Restart=always

[Install]
WantedBy=multi-user.target