Support Ansible 12 (ansible-core 2.19) SSH_ASKPASS and password_mechanism
https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_12.html#noteworthy-plugin-changes
https://github.com/ansible/ansible/pull/83936
refs #1258
Notes to self
sshpasscommand, wrapssshto inject password non-interactively. Last release 1.10 in 2023SSH_ASKPASSopenssh environment variable, program thatsshwill run to request a password if it has no terminal andDISPLAYis also set. SupportSSH_ASKPASS_REQUIREopenssh >= 8.4 environment variable,{never|prefer|force}policy to decide when to use program inSSH_ASKPASS.ssh-askpassX11-based pass-phrase dialogssh_connection.password_mechanismAnsible >= 12 SSH connection parameter,{ssh_askpass|sshpass|disable}
See
- https://sourceforge.net/projects/sshpass/
- https://manpages.debian.org/bookworm/openssh-client/ssh.1.en.html#ENVIRONMENT
- https://manpages.debian.org/bookworm/ssh-askpass/ssh-askpass.1.en.html
- https://docs.ansible.com/ansible/devel/collections/ansible/builtin/ssh_connection.html#parameter-password_mechanism
Ansible >= 12 (ansible-core >= 2.19) is able to act as an SSH_ASKPASS command, so it no longer requires sshpass to support connections using ansible_ssh_password.
CI is currently using sshpass 1.05 on localhost tests (macOS) https://github.com/mitogen-hq/mitogen/blob/08f0eca1c22cf45a1d8fb5159a907ea571a3a1b0/.ci/localhost_ansible_tests.py#L20-L28
it is pre-installed on Ubuntu test runners, e.g.
sshpass 1.09-1 -- https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#installed-apt-packages