What a Module Actually Is
How modules wrap actions into reusable units.
What a Module Actually Is is a free Ansible Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Ansible Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Modules Do the Real Work
Every action Ansible takes runs through a module: a small program that knows how to install a package, copy a file, or restart a service.
One Module, One Job
Each module handles a single kind of task. The copy module copies files, the user module manages accounts. You compose them to do bigger things.
Modules Run on the Remote Host
Ansible ships the module to the target node, runs it there, then collects the result. The control node never touches the managed system directly.
You Describe State, Not Steps
You tell a module the desired state, like present or started. The module figures out the steps needed to get there.
ansible.builtin.service:
name: nginx
state: startedModules Take Arguments
You pass a module key-value arguments that describe what you want. Each module documents exactly which keys it accepts.
ansible.builtin.copy:
src: app.conf
dest: /etc/app.confMost Modules Are Idempotent
Run a good module twice and it changes nothing the second time. It checks the current state first, so it is idempotent and safe to re-run.
Modules Return Structured Results
Every module returns JSON telling Ansible whether it changed anything, succeeded, or failed. That is how you see ok, changed, or failed in output.
Built-in Modules Come Free
Ansible ships with hundreds of built-in modules under the ansible.builtin namespace, covering files, packages, services, and more out of the box.
Call a Module Ad-Hoc
You can invoke any module from the command line with -m, no playbook needed. This is great for quick, one-off tasks.
ansible web -m pingModules Beat Raw Shell
You could shell out with raw commands, but modules give you idempotency and clear results. Prefer a real module over shell whenever one exists.
Use the Full Module Name
The modern style is the fully qualified name like ansible.builtin.copy. It makes clear exactly which collection a module comes from.
ansible.builtin.file:
path: /tmp/data
state: directoryQuick Check
Think about what makes Ansible modules safe to run repeatedly.
Recap
A module is a small program that does one job on the remote host, takes arguments, describes desired state, and returns a result you can trust. 🧩
Frequently asked questions
Is the “What a Module Actually Is” lesson free?
Yes — the full text of “What a Module Actually Is” is free to read here on the web, and the Ansible Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Ansible Academy course, upgrade to CoddyKit PRO.
What will I learn in “What a Module Actually Is”?
How modules wrap actions into reusable units. You practise Ansible Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Ansible Academy?
No prior experience is required. Ansible Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “What a Module Actually Is” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Ansible Academy lesson?
Yes. Every Ansible Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What a Module Actually Is
- Install Packages with the package Module
- Manage Services with systemd
- Read the Docs with ansible-doc