Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 322 Bytes

Run-shell-command-in-all-hosts.md

File metadata and controls

15 lines (9 loc) · 322 Bytes
  • Date : 2019-02-18
  • Tags : #ansible #devops

Run shell command in all hosts

To run a shell command in all hosts, you can use the module name raw and provide shell command to module args.

Example:

  • To list all CPU model name of hosts
$ ansible all -m raw -a "cat /proc/cpuinfo | grep 'model name'"