Table of contents
- Login AWS and launch 3 Red Hat Instance (One Controller Node and 2 Target Node)
- Log in to controller node and perform following steps:
- Now login one of the target node and perform following steps:
- Now repeat the 3rd process with other target node
- Login controller node and execute the below step to run any linux command on single , multiple or all hosts
Steps
Login AWS and launch 3 Red Hat Instance (One Controller Node and 2 Target Node)
Log in to controller node and perform following steps:
To update server : yum update -y
Install ansible : yum install ansible-core
update ansible inventory by copying public or private ip of target node
update /etc/ansible/host file : public-ip ansible_user=<user> ansible_password=<password>
do ansible all --list-host , you will see the hosts(target node ips)
In controller node do : ansible-config init --disabled > /etc/ansible/ansible.cfg
vim /etc/ansible/ansible.cfg and edit , save this file by doing this
host_key_checking=False
Now login one of the target node and perform following steps:
vim /etc/ssh/sshd_config.d/50-cloud-init.conf and write and save file with
PasswordAuthentication yes
vim /etc/ssh/sshd_config and edit , save
PermitRootLogin yes
restart sshd service
systemctl restart sshd
Change root password
passwd root
Now repeat the 3rd process with other target node
Login controller node and execute the below step to run any linux command on single , multiple or all hosts
ansible all -m command -a <linux-command>
Thank you for reading โฃ๏ธ
ย