ansible configuration

37 views
Skip to first unread message

Sakshi Jain

unread,
Feb 7, 2024, 12:06:51 AM2/7/24
to ansibl...@googlegroups.com, ansible...@googlegroups.com

So basically two users 

User1 , user2   user is a sudo user 


There are 5 servers : server1 , server2 , server3, server4, server5

We need password less connection from server1 to all other servers 

 I am facing issue with key password less authnetication


Tha playbook are be executed as sudo user that I have mentioned in the playbook as
become: yes

become_user : user2


I have copied the public key ~/.ssh/id_rsa.pub of user2 from server1  to ~/.ssh/authorized keys in all the other servers 

But its not working 


I am able to login with user1 and user2 from server1 to server2 to all the servers 


But when I am trying to execute the playbook it throws error 



I have tried to mention ansible_user= user1 in the inventory 


What shall I do ?

Sakshi Jain

unread,
Feb 7, 2024, 12:25:14 AM2/7/24
to ansibl...@googlegroups.com, ansible...@googlegroups.com
also while executing the playbook from server1 , shall we execute as user1 or user2  ? 
and in inventory shall i mention as user1 or user2 
as in playbook, it needs the privileged permission from the sudo user 
Reply all
Reply to author
Forward
0 new messages