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.


![fatal: []: FAILED! => {"changed": false, "failed": true, "msg": "Could not find or access '/tmp/filename'"}](https://images.squarespace-cdn.com/content/v1/57068a2507eaa0b8239710c0/1522833314665-G9Z1PCR4KQGZ9ZLK5MIH/image-ansible.png)