Ansible setup lab 6:
Setup control node
Pick one of the ec-2 instance we created in Lab 5 as control node
Connect to the control node
Switch to root user
$ sudo -i
#
Update the package list
# yum update -y
Create a new user ansible-user
# useradd ansible-user
# password ansible-user
# password123
Add privileges to the user ansible-user
# usermod -aG wheel ansible-user
Switch to that user
# su - ansible-user
$
Now generate ssh keys
ssh-keygen
press enter three times to accept all the defaults.
Now enable password based authentication
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd
Now install Ansible
sudo amazon-linux-extras install ansible2 -y
verify ansible Setup
ansible --version
Create a folder in home directory i.e.
cd
mkdir ansible-dir
cd ansible-dir
touch hosts