Run Shell Commands with command & shell
Execute arbitrary commands on remote nodes.
Run Real Commands Remotely
Sometimes you just need to run a raw command on your servers. Ansible gives you two modules for that: command and shell. 🖥️
The command Module
The command module runs a program directly on the remote host. It is the safe default for simple, single commands.
ansible all -m command -a "uptime"All lessons in this course
- Anatomy of the ansible Command
- Patterns: Targeting all, web & host1
- Run Shell Commands with command & shell
- Privilege Escalation with become