connection to multiple hosts with all different passwords

17 views
Skip to first unread message

necc...@gmail.com

unread,
Mar 7, 2018, 7:48:45 AM3/7/18
to Ansible Project
Hi all,

I'm new to Ansible, so please excuse myl lack of knowledge

I'm tryting to handle multiple hosts that need to execute some tasks being root.
While it's not a good idea to have all root-ssh-keys stored on one machine (the Ansible host), I want to connect to a box using a generic "ansible" user and then do a sudo (or su) to root
All hosts have different root-passwords. So I put some in an ansible-vault file and encrypted it.

Now I trie to build a playbook, that connects to a group of hosts - using the "ansible" user - sudo to root and e.g. 'apt-get upgrade'
According to the hostname, the matching root-password should be read from the ansible-vault file.
I know that I can specify the decrypt password with "--ask-vault-pass".
But how to tell the Playbook to look for a certain id, get the password and performe the sudo ?


regards

Reply all
Reply to author
Forward
0 new messages