Skip to content

Commit 51dd80f

Browse files
adamlazik1ekohl
authored andcommitted
Fixes #37803 - Remove hardcoded ProxyCommand
Previously, we added a hardcoded `ProxyCommand=none` because ipa-client-install added `ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h` into `/etc/ssh/ssh_config`, which caused failure to execute ansible commands on systems without the `/sbin/nologin` shell [1]. However; this also prevents users from using their own jump host in the ssh configuration since the hardcoded command line arguments always take precedence. Since this issue was fixed in the ipa tooling 3 years ago (they now use the `Match exec true` rule [2]), I propose we remove the hardcoded ProxyCommand to allow users to specify their own jump hosts. The same is being done for remote execution [3]. Some users who have configured the ipa client before the fix landed in ipa might still report that they are getting errors when trying to run ansible commands because the ProxyCommand specified in `etc/ssh/ssh_config` is failing to execute. We should suggest these users to remove the ProxyCommand from ssh config, which should fix all of their issues originating from this. This is more of a problem of the old ipa tooling rather than a problem of foreman. [1] https://projects.theforeman.org/issues/25481 [2] https://pagure.io/freeipa/issue/7676 [3] theforeman/smart_proxy_remote_execution_ssh#117
1 parent 907200b commit 51dd80f

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 -o ServerAliveInterval=15 -o ServerAliveCountMax=3'
12+
$ssh_args = '-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
@@ -40,7 +40,7 @@
4040
'export FOREMAN_SSL_KEY="/etc/puppetlabs/puppet/ssl/private_keys/foo.example.com.pem"',
4141
'export FOREMAN_SSL_CERT="/etc/puppetlabs/puppet/ssl/certs/foo.example.com.pem"',
4242
'export FOREMAN_SSL_VERIFY="/etc/puppetlabs/puppet/ssl/certs/ca.pem"',
43-
'export ANSIBLE_SSH_ARGS="-o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=15 -o ServerAliveCountMax=3"',
43+
'export ANSIBLE_SSH_ARGS="-C -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=15 -o ServerAliveCountMax=3"',
4444
])
4545
end
4646
end
@@ -86,7 +86,7 @@
8686
'export FOREMAN_SSL_KEY="/etc/puppetlabs/puppet/ssl/private_keys/foo.example.com.pem"',
8787
'export FOREMAN_SSL_CERT="/etc/puppetlabs/puppet/ssl/certs/foo.example.com.pem"',
8888
'export FOREMAN_SSL_VERIFY="/etc/puppetlabs/puppet/ssl/certs/ca.pem"',
89-
'export ANSIBLE_SSH_ARGS="-o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=15 -o ServerAliveCountMax=3"',
89+
'export ANSIBLE_SSH_ARGS="-C -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=15 -o ServerAliveCountMax=3"',
9090
])
9191
end
9292
end

0 commit comments

Comments
 (0)