ansible-plugin icon indicating copy to clipboard operation
ansible-plugin copied to clipboard

Remove -k when using sshpass, this is not need by Jenkins and freezin…

Open GeVa2072 opened this issue 9 years ago • 3 comments

Remove -k when using sshpass, this is not need by Jenkins and freezing ansible-playbook

GeVa2072 avatar Sep 27 '16 12:09 GeVa2072

Can you give me more details on your setup. I cannot reproduce your issue. The -k flag is required when using a username/password instead of a private key for the SSH connection.

jcsirot avatar Dec 27 '16 08:12 jcsirot

The issue can be reproduced when one uses password meant to be used by sudo. Without jenkins it would look like: ansible -i inventory -m command -a hostname --become -K some-host It works when using ssh key to connect with ssh, and password to authorize sudo.

But plugin always adds -k when using password credentials, so you can't combine these two: key for ssh connection and password credentials for sudo authorization. Under the hood ansible asks for two passwords and gets only one, that's why it hangs.

This PR doesn't seem to address the issue too well though. It always removes -k so people would then need to add -k manually when not using sudo. Which breaks existing jobs.

bjakubiak avatar Feb 09 '17 20:02 bjakubiak

I'd say "-k" option is needed, make it configurable. It's quite a rare case that you have immediately a setup with all certificates and keys.

svscorp avatar Oct 26 '17 11:10 svscorp