Set autossh systemd RuntimeDirectory
This commit is contained in:
parent
25bde1105f
commit
8b3ecdbb9c
@ -19,16 +19,13 @@
|
|||||||
- id_ed25519
|
- id_ed25519
|
||||||
- id_rsa
|
- id_rsa
|
||||||
|
|
||||||
- name: create directories
|
- name: "create {{ autossh_etc_path }}"
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ autossh_etc_path }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0755
|
mode: 0755
|
||||||
state: directory
|
state: directory
|
||||||
loop:
|
|
||||||
- "{{ autossh_etc_path }}"
|
|
||||||
- "{{ autossh_run_path }}"
|
|
||||||
|
|
||||||
- name: install package
|
- name: install package
|
||||||
package:
|
package:
|
||||||
|
@ -4,5 +4,6 @@ AUTOSSH_POLL=60
|
|||||||
AUTOSSH_FIRST_POLL=30
|
AUTOSSH_FIRST_POLL=30
|
||||||
AUTOSSH_GATETIME=0
|
AUTOSSH_GATETIME=0
|
||||||
AUTOSSH_PORT=22000
|
AUTOSSH_PORT=22000
|
||||||
|
AUTOSSH_PIDFILE={{ autossh_run_path }}/{{ item.name }}.pid
|
||||||
SSH_OPTIONS="{{ item.options | join(' ') }}"
|
SSH_OPTIONS="{{ item.options | join(' ') }}"
|
||||||
SSH_HOST={{ item.host }}
|
SSH_HOST={{ item.host }}
|
||||||
|
@ -13,6 +13,7 @@ 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
|
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
|
Restart=always
|
||||||
RestartSec=60
|
RestartSec=60
|
||||||
|
RuntimeDirectory=autossh
|
||||||
PIDFile={{ autossh_run_path }}/%i.pid
|
PIDFile={{ autossh_run_path }}/%i.pid
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
Loading…
Reference in New Issue
Block a user