waits for password when I don't want it to

8 views
Skip to first unread message

Dylan Martin

unread,
Jan 29, 2020, 12:01:10 PM1/29/20
to Ansible Project
Hi all.

I have an environment with several hundred unreliable machines.  Sometimes they're just dead, sometimes they're misconfigured.   I always encounter some where the keys in my ssh-agent don't work and it prompts me to enter the password and it waits for me to hit enter a bunch of times before the play will proceed.  

Is there a way to configure ssh or ansible to just fail when this happens?  I sometimes will run plays with password auth instead of ssh keys, so I don't want to completely disable that.

Thanks!
-Dylan

Kai Stian Olstad

unread,
Jan 29, 2020, 12:32:54 PM1/29/20
to ansible...@googlegroups.com
You could set ssh to only use keys by setting the variable
ansible_ssh_common_args="-o PreferredAuthentications=publickey".
It's also possible to set the environment variable
ANSIBLE_SSH_COMMON_ARGS to the same value.


--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages