Friday, January 3, 2020

Ansible script to ping servers

Ansible Script to ping servers


Redhat Ansible is an opensource configuration management, infrastructure provisioning and application deployment automation tool which can be used for both cloud and on-prem solutions

Here is a code snippet which will test the reach-ability of instances or target nodes via ansible playbook


 code:








Output for the above yml file would be as below:




Hope this helps to write simple playbook which will ping servers based on a list. Another enhancement that can be done here is read a list of hosts to ping from a csv and use this YML to ping test those servers

Happy Ansible !!!

 

No comments:

Post a Comment