Last Updated: February 25, 2016
·
1.515K
· k4ml

Quickly run command on multiple servers using ansible

One example use case of ansible for sysadmin. Quickly run command on multiple servers:-

ansible all -i server1.com,server2.com, -a 'dig +short www.google.com'
server1.com | success | rc=0 >>
74.125.135.106
74.125.135.147
74.125.135.99
74.125.135.103
74.125.135.104
74.125.135.105

server2.com | success | rc=0 >>
74.125.135.147
74.125.135.99
74.125.135.103
74.125.135.104
74.125.135.105
74.125.135.106

Above will check dns entry for www.google.com from server1.com and server2.com.