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'"
To run a shell command in all hosts, you can use the module name raw
and provide shell command to module args.
Example:
$ ansible all -m raw -a "cat /proc/cpuinfo | grep 'model name'"
Sound good ?
0 kudos, click the star if you think this post is value !
Read more
about #til