Donnerstag, 18. September 2014

cli ansible vs clustershell : running commands on multiple hosts.

Let us start with CentOS 6.5
1) enable epel:  yum locainstall -y  http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
2) yum install clustershell -y
3) yum install ansible

Let us run who command on multiple hosts:
clush -w localhost,anotherhost -B -b w
ansible all -i 'localhost,anotherhost,' -c local -m command -a "w"

Then Analyze output....

1 Kommentar:

Paul hat gesagt…

ansible all -i 'localhost,125.1.39.101,' -c local -m shell -a "uptime"
125.1.39.101 | CHANGED | rc=0 >>
13:30:03 up 49 days, 36 min, 1 user, load average: 0,17, 0,16, 0,15

localhost | CHANGED | rc=0 >>
13:30:03 up 49 days, 36 min, 1 user, load average: 0,17, 0,16, 0,15


real 0m2.077s
user 0m1.734s
sys 0m0.565s


time clush -w localhost,125.1.39.101 -B -b uptime
---------------
125.1.39.101
---------------
13:30:57 up 18 days, 3:29, 0 users, load average: 0,00, 0,01, 0,05
---------------
localhost
---------------
13:30:10 up 49 days, 36 min, 1 user, load average: 0,14, 0,15, 0,14

real 0m0.424s
user 0m0.197s
sys 0m0.068s