Using ansible ping module check connectivity between two nodes
Once server and client machine is configured with SSH passwordless authentication and ansible installed in server, we will verify if ansible can connect from server to client. If you have not configured refer page
Login to server node and create a directory to save all the work done in one location Eg:mywork
[root@ansible ~]# mkdir mywork
[root@ansible ~]# cd mywork/
Create new file called "hosts" under "mywork" and add your client host name in the file as shown below.
[root@ansible mywork]# cat hosts
[mynodes]
node01
Now is the time to check if ansible from server machine able to communicate to client node01
To check this we will use ansible module called ping.
Run command as shown below.
[root@ansible mywork]# ansible all -i hosts -u root -m ping
node01 | SUCCESS => {
"changed": false,
"ping": "pong"
}
Once server and client machine is configured with SSH passwordless authentication and ansible installed in server, we will verify if ansible can connect from server to client. If you have not configured refer page
Login to server node and create a directory to save all the work done in one location Eg:mywork
[root@ansible ~]# mkdir mywork
[root@ansible ~]# cd mywork/
Create new file called "hosts" under "mywork" and add your client host name in the file as shown below.
[root@ansible mywork]# cat hosts
[mynodes]
node01
Now is the time to check if ansible from server machine able to communicate to client node01
To check this we will use ansible module called ping.
Run command as shown below.
[root@ansible mywork]# ansible all -i hosts -u root -m ping
node01 | SUCCESS => {
"changed": false,
"ping": "pong"
}
Comments
Post a Comment