Ansible Installation

ansible-config init --disabled > ansible.cfg



/etc/ansible/ansible.cfg
[default]
inventory=/etc/ansible/hosts 
remote_user=<username>
ask_pass=False

[priviledge_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=False #whenever it will move to the user root using sudo do not ask for the password.

$vim /etc/ansible/hosts #add your group and thier recommended user IP.
like[groupName] 
<PublicIP> ansible_user=ravi ansible_password=Enter your user's password here.

$ssh-keygen -t rsa
$connect any one of the client server and add user <username>

$cd .ssh
$ssh-copy-id <user>@<PublicIP>
$ssh <user>@<PublicIP> #connect your user client machine.

Comments