Skip to content

Commit 7eec0d4

Browse files
adamruzickaekohl
authored andcommitted
Fixes #35925 - Enable ssh server keepalive for ansible
To properly detect if the remote end just disappears
1 parent 1b04094 commit 7eec0d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

manifests/plugin/ansible/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$working_dir = '/tmp'
1010
$host_key_checking = false
1111
$roles_path = ['/etc/ansible/roles', '/usr/share/ansible/roles']
12-
$ssh_args = '-o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s'
12+
$ssh_args = '-o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=15 -o ServerAliveCountMax=3'
1313
$install_runner = true
1414
$collections_paths = ['/etc/ansible/collections', '/usr/share/ansible/collections']
1515
case $facts['os']['family'] {

spec/classes/foreman_proxy__plugin__ansible_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
'export FOREMAN_SSL_KEY="/etc/puppetlabs/puppet/ssl/private_keys/foo.example.com.pem"',
4444
'export FOREMAN_SSL_CERT="/etc/puppetlabs/puppet/ssl/certs/foo.example.com.pem"',
4545
'export FOREMAN_SSL_VERIFY="/etc/puppetlabs/puppet/ssl/certs/ca.pem"',
46-
'export ANSIBLE_SSH_ARGS="-o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s"',
46+
'export ANSIBLE_SSH_ARGS="-o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=15 -o ServerAliveCountMax=3"',
4747
])
4848
end
4949
end
@@ -90,7 +90,7 @@
9090
'export FOREMAN_SSL_KEY="/etc/puppetlabs/puppet/ssl/private_keys/foo.example.com.pem"',
9191
'export FOREMAN_SSL_CERT="/etc/puppetlabs/puppet/ssl/certs/foo.example.com.pem"',
9292
'export FOREMAN_SSL_VERIFY="/etc/puppetlabs/puppet/ssl/certs/ca.pem"',
93-
'export ANSIBLE_SSH_ARGS="-o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s"',
93+
'export ANSIBLE_SSH_ARGS="-o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=15 -o ServerAliveCountMax=3"',
9494
])
9595
end
9696
end

0 commit comments

Comments
 (0)