til

#TIL : Run shell command in all hosts

I learned on 2019-02-18 about ansible, devops

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'"

Enjoyed this?

Leave a kudo — it means a lot.

0