Run a command as root on a group of hosts
CautionExecutes the command with sudo on every host of the group, after prompting for the privilege escalation password.
ansible group -b -K -m command -a 'command'Edit the highlighted values, then copy. They are inserted as typed, without shell escaping.
Report an issue (opens in a new tab) wrong command, wrong danger level, typo… (on GitHub)
Adapted from tldr-pages (common/ansible.md), licensed under CC BY 4.0.