Ask for a new password for every host using --ask-pass

43 views
Skip to first unread message

Dennis Klein

unread,
Mar 3, 2017, 10:47:59 AM3/3/17
to Ansible Project
Hello,

i need to add my ssh key first to be able to connect using it.

I made a simple playbook for it:

- hosts: all
  tasks:
    - name: add admin ssh keys
      authorized_key: user=root key={{ ssh_key[item] }} state=present
      with_items:
        - user1
        - user2
        - user3

I'm only asked once for a password, but all servershave different passwords.

Why don't asks Ansible for a password every time the login via key don't works?

Z-obaze

unread,
Apr 5, 2017, 3:27:35 AM4/5/17
to Ansible Project
Hi,

That's exactly what I'm looking for.
I was trying to find a way to automatically configure my hosts for ansible with one playbook by create a new user, add the ssh keys etc... but my servers don't have the same password, so i'm trying to find a way where ansible ask the password for each host.
So far i'm like you, it asks the password only at the begining and apply that password for all of the hosts.

Have you found a way to do what you were looking for?

Thanks

Pierre
Reply all
Reply to author
Forward
0 new messages