Add autossh role

This commit is contained in:
2019-12-01 20:40:12 -06:00
parent f99c956212
commit e13a935f80
6 changed files with 172 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# {{ ansible_managed }}
AUTOSSH_POLL=60
AUTOSSH_FIRST_POLL=30
AUTOSSH_GATETIME=0
AUTOSSH_PORT=22000
SSH_OPTIONS="{{ item.options | join(' ') }}"
SSH_HOST={{ item.host }}

View File

@@ -0,0 +1,19 @@
# {{ ansible_managed }}
[Unit]
Description=autossh %I
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User={{ autossh_user }}
EnvironmentFile={{ autossh_etc_path }}/%i
ExecStart=
ExecStart=/usr/bin/autossh -C -q -l {{ autossh_user }} -N -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=no $SSH_OPTIONS $SSH_HOST
Restart=always
RestartSec=60
PIDFile={{ autossh_run_path }}/%i.pid
[Install]
WantedBy=multi-user.target