Skip to main content

Using ansible ping module check connectivity between two nodes

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"
}

Comments

Popular posts from this blog

Ansible script to stop iptables

 Ansible script to stop iptables and disable during boot Step 1. [root@cluster playbooks]# pwd /root/playbooks [root@cluster playbooks]# cat hosts [webservers] 169.254.41.221 169.254.41.222 Step2. [root@cluster playbooks]# cat iptables.yml --- - name: stop ipatbles and disable   hosts: webservers   tasks:   - name: stop iptables     service: name=iptables state=stopped   - name: disbale on iptable on boot     service: name=iptables enabled=no Step3: [root@cluster playbooks]# ansible-playbook iptables.yml PLAY [stop ipatbles and disable] *********************************************** TASK [setup] ******************************************************************* ok: [169.254.41.222] ok: [169.254.41.221] ok: [localhost] TASK [stop iptables] *********************************************************** changed: [localhost] ok: [169.254.41.221] ok: [169.254.41.222] TASK [disbale on iptable on boot] *********************************...

Understanding TCP & UDP

 TCP (Transmission Control Protocol) is stateful. This means it maintains a connection state between the communicating parties throughout the communication session. Stateful Nature of TCP Connection Establishment : TCP requires a connection to be established between the sender and receiver before data transmission can begin. This is done through a process called the three-way handshake. Three-Way Handshake : This process involves the exchange of three messages (SYN, SYN-ACK, and ACK) to establish a reliable connection. Maintaining State : During the connection, TCP keeps track of various parameters to ensure reliable and ordered data delivery. Sequence Numbers : TCP assigns sequence numbers to each byte of data to ensure it is received in the correct order. Acknowledgements (ACKs) : The receiver sends acknowledgements for the received data packets. If an ACK is not received, the sender retransmits the data. Flow Control : TCP uses a window mechanism to control the rate of data tran...

Basics of OSI Model in networking

 The OSI (Open Systems Interconnection) model is a conceptual framework used to understand and standardize the functions of a telecommunication or computing system. It divides the process of networking into seven distinct layers, each responsible for specific tasks related to data transmission across a network. The OSI model was developed by the International Organization for Standardization (ISO) to help different networks and devices communicate with each other in a standardized way. Here’s a brief overview: Physical Layer: This is the foundation. It’s like the cables and the hardware that connect computers. Imagine the physical wires or the radio signals used for Wi-Fi. Data Link Layer: This layer is responsible for making sure that the data gets from one point to another without errors. Think of it as the traffic cop that ensures data goes to the correct place on the same network. Network Layer: This is where routing happens. It decides the best path for the data to travel from...