Ansible enterprise Setup
- Lets create 3 VMs
- ubuntu 18 VMs => 2
- centos 7 VM => 1
- Once the 3 VMs are running
- Lets create one user called as devops on all the three server and give this user sudo permissions without prompting for password
- Creating user with password in Linux
- Check if password logins are allowed
- Change PasswordAuthentication to yes in /etc/ssh/sshd_config and restart sshd service using
sudo service sshd restart
- Change PasswordAuthentication to yes in /etc/ssh/sshd_config and restart sshd service using
- Now create a user called as devops
sudo adduser devops- Lets add sudo permissions to the devops user without password
sudo visudo
- Repeat the same activity on the other ubuntu server
- Repeat the same activity on the centos7
sudo useradd devops sudo passwd devops
- Check if password logins are allowed
- Install ansible on the control node (ubuntu)
- Ansible has configurations present in /etc/ansible
- Now lets create a configuration in such a way that devops user will be able to login into the nodes without prompting for passwords
- Lets create a key pair in ansible control node
ssh-keygen
- Now lets copy the public key to the nodes and let ssh verify the connection using keys
ssh-copy-id devops@<ip of node>
*
Note:
- Linux Sessions Refer Here
