Quick Ansible One-liners
Had to check a good bunch of servers this weekend after some testing. I gathered a list of the hostnames, placed them into the hosts file, then with the below I could see them all up.
ansible serverlist -m ping
Then I could see who was up and responded to a ping, then this next one liner would check they were all up and I could connect to them
ansible serverlist -m shell -a "hostname;date"
Very easy and simple, hope this helps you out
I am always interested in feedback so please feel free to add any comments, or you can mail me here. If you would like to submit a quick tip with full credit and links back to your site then also feel free to contact me.