shell module
The module that runs a command through the host's shell, so pipes, redirection and variables work, unlike the command module.
In more detail
That extra power also makes it riskier: anything built from variables can be interpreted by the shell in unexpected ways. Like the command module it cannot tell whether it changed anything. Use it only when no dedicated module fits and the command module is not enough.
Related terms
- command module — The module that runs any program you name on the host and reports what it printed, without being able to tell whether it changed anything.
- shell — The program that reads the commands you type, runs them and shows the results; sh and bash are common ones.
- idempotency — The property of an operation that gives the same result whether you run it once or many times, because a repeat run finds nothing left to do.
Taught in
- Modules And Idempotency — Ansible Configuration Management at Scale
- Graded On A Machine You Never Touched — RHCE in Ansible (EX294): Automate Red Hat Systems
- Deploying Files: file, copy, lineinfile And blockinfile — RHCE in Ansible (EX294): Automate Red Hat Systems