ansible-plugin
ansible-plugin copied to clipboard
Remove -k when using sshpass, this is not need by Jenkins and freezin…
Remove -k when using sshpass, this is not need by Jenkins and freezing ansible-playbook
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.
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.
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.