ansible/roles/autossh/templates/autossh.service.j2

20 lines
504 B
Django/Jinja

# {{ 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