I would like to quickly monitor some hosts using commands like ps,dstat etc using ansible-playbook. The ansible command itself perfectly does what I want, for instance I'd use: ansible -m shell -a "ps -eo pcpu,user,args | sort -r -k1 | head -n5" and it nicely prints all std output for every host like this: localhost | success | rc=0 >> 0.0 root /sbin/init 0.0 root [kthreadd] 0.0 root [ksoftirqd/0]
