Add autossh role
This commit is contained in:
		
							
								
								
									
										8
									
								
								roles/autossh/templates/autossh.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								roles/autossh/templates/autossh.j2
									
									
									
									
									
										Normal 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 }}
 | 
			
		||||
							
								
								
									
										19
									
								
								roles/autossh/templates/autossh.service.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								roles/autossh/templates/autossh.service.j2
									
									
									
									
									
										Normal 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
 | 
			
		||||
		Reference in New Issue
	
	Block a user