// learn · linux · rhce · 10 min

Ansible control node & inventory.

Ansible is agentless — one control node pushes Python modules to a whole fleet over SSH, with nothing to install on the targets. Watch the model go from `dnf install ansible-core` to a live ad-hoc command fanning out across grouped hosts.

Ansible control node and inventory animated tutorial. Agentless push architecture over SSH, installing ansible-core, writing INI and YAML inventories, host ranges, groups and group_vars, testing connectivity with the ping module, ad-hoc commands with -m and -a, privilege escalation, and project defaults in ansible.cfg. RHCE EX294 ready.
// ansible · control node & inventory

Ansible is agentless: one control node pushes work to a fleet over SSH. Watch the model go from install → inventory → groups → a live ad-hoc command fanning out across hosts.

// before you start
you should know
  • ·Comfortable with SSH and SSH key auth
  • ·Basic Linux shell + package management (dnf)
  • ·Know what YAML looks like (helps, not required)
by the end you'll

Install Ansible on a control node, write an inventory with groups, prove connectivity with the ping module, and run ad-hoc commands across a fleet.

pace: 10 minutes

ansible — step 1 / 6 · the model
🛰️ control · ansible-corepushes over ssh →
🛰️ control node
│ ssh + python │
[webservers]
🖥️ servera○ idle
🖥️ serverb○ idle
[dbservers]
🖥️ serverc○ idle

Agentless push — how Ansible reaches a fleet

Ansible has no agent. The CONTROL NODE opens an SSH connection to each MANAGED NODE, copies a tiny Python module over, runs it, captures the result, and deletes it. Managed nodes need only an SSH server and Python — nothing to install, no daemon to keep alive. That's the whole architecture: push over SSH, run, clean up. Every module is written to be idempotent, so re-running a play changes nothing if the system already matches.

$dnf install ansible-core
$ansible --version
$ssh servera 'python3 --version'
// key insight

Everything in Ansible flows from one idea: the control node pushes Python over SSH and the managed nodes stay dumb. The inventory names the fleet, groups carve it into targets, the ping module proves the path, and ad-hoc commands let you act now — but the moment a task is worth repeating, it belongs in a playbook so it's idempotent and reviewable.

// exam-ready · control node, inventory & ad-hoc
$dnf install ansible-core
$ansible --version
$ansible all -m ping
$ansible all --list-hosts
$ansible GROUP --list-hosts
$ansible-inventory --graph
$ansible all -m setup
$ansible all -a "CMD"
$ansible H -m shell -a "a | b"
$ansible H -m dnf -a "name=X state=present" -b
$ansible H -m service -a "name=X state=started enabled=true" -b
$ansible H -m copy -a "src=… dest=…"
$-i inventory
$-u USER -b --become-user=root
$./ansible.cfg [defaults]
$ansible-config dump --only-changed
// check yourself
4 quick questions
Q1

What does a managed node need installed for Ansible to manage it?

Q2

`ansible all -m ping` returns SUCCESS → pong. What did that actually prove?

Q3

You want to install httpd on the webservers group, just once, right now, as root. Best ad-hoc command?

Q4

You run Ansible from a project directory that has its own ./ansible.cfg, and /etc/ansible/ansible.cfg also exists. Which wins?

These aren't graded — they're just for active recall, which is what actually makes the lesson stick.

🔑
// the thing Ansible rides on

SSH key authentication

Ansible is only as smooth as your SSH. Set up key-based auth to every managed node and `ansible all -m ping` just works — no passwords, no prompts.

open →
// more in systems

keep going — these pair well with what you just learned.

see all systems
back to RHCSA / RHCE trackall lessons