Ansible Day-37

Now try ssh using without password

go to server

generating public /private rsa key pair

List

Private key

Public key

Add ssh key from server to node

Verify in node ssh key copied

Check node 172.31.45.151 is server ip

now see ssh login in node from server without password working fine.

Edit hostfile in server; create one group webservers and add node ip address in the group

Create a one file hosts this location /etc/ansible/hosts

create one group webservers for inside hosts file

Enable default values in ansible.cfg file

add this line

now check ansible recognize hosts or not

webservers node

Push code in first node in webservers group

Push code in 0:1

push code in the two servers

Push code in servers two ways found Ad-hoc and playbooks

now see Ad.hoc commands

Check nodes are reachable

remove python warning interpreter_python=auto_silent; add this line for ansible.cfg file

see now no python warning found

Find hostname for all nodes

find hostname without command

Find IP

find specific node ip

find date

list the file in current directory for all nodes

create a file in all nodes

list all nodes

install a packages

Check tree installed

remove packages

check removed

install tree

Check tree installed

Yaml

install git

check git installed

remove git

install package in one server

verify

install httpd

verify httpd installed

remove httpd

verify

install docker

verify docker installed

remove docker

verify docker unistalled

install httpd

start httpd service

check service is running

create a user

verify

to collect information from node