ansible all -m command -a 'uptime'

Category: IaC & Automation

ansible all -m command -a 'uptime'

Run a command on every managed host

Executes uptime on all hosts using the command module, which runs a program without a shell. The -a flag passes module arguments, here the command to run. Use the shell module instead when you need pipes or redirection. Related: ansible all -m shell.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.