0Pricing
Ansible Academy · Lesson

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

  1. Anatomy of the ansible Command
  2. Patterns: Targeting all, web & host1
  3. Run Shell Commands with command & shell
  4. Privilege Escalation with become
← Back to Ansible Academy