http://mithuntechnologies.com/
http://mithuntechnologies.co.in/
Ansible Installation in Amazon Linux
sudo yum install python3 -y
sudo yum install python-pip
pip install ansible
pip install boto3
pip install botocore
sudo yum install python3 -y
sudo yum install python-pip
pip install ansible
pip install boto3
pip install botocore
1) Now generate SSH key in Ansible Server:
sudo su - ansible
ssh-keygen
2) Copy it to Host servers as ansible user:
Repeat below command by updating HOST IP for all the HOST Servers.
ssh-copy-id ansible@<HostIP>
Update Host Inventory in Ansible Server to add host servers’ details.
1) Add Host Server details
vi /etc/ansible/hosts
# Connect using username and password
192.168.1.105 ansible_user=ansible ansible_password=password
# Connect using username and pem(Make Sure Have pem file at given path)
172.31.35.23 ansible_user=ec2-user ansible_ssh_private_key_file=~/aws.pem
# If ssh keys are copied
172.31.35.23
2) Use ping module to test Ansible and after successful run you can see the below output.
ansible all -m ping
172.31.35.23 | SUCCESS => {
"changed": false,
"ping": "pong"
}
3) Install sshpass in Ansible server if you get below error .
"to use the 'ssh' connection type with passwords, you must install the sshpass program
$ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/sshpass-1.06-2.el7.x86_64.rpm
Mithun Technologies +91-9980923226 devopstrainingblr@gmail.com ...