Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Practise

Ansible labs

Automating without breaking things: idempotent playbooks, reusable roles, secrets that stay put, and tests that prove it.

Back to all 761 labsHow to run a lab

  • 113 labs
  • 82 hours of practice
  • 88 on a virtual machine

DSOXLab runs these labs on your machines

DSOXLab is the command-line tool behind every lab on this page. It prepares the environment, hands you the mission and checks the result, so the score comes from the state you actually built.

  1. Prepare It sets up the lab environment: the virtual machines, and the cluster when the lab uses one. dsoxlab start <lab>
  2. Practise You read the mission, then solve it yourself on the system, connecting to the machines when the lab has some. dsoxlab challenge
  3. Check It runs the tests on the state you produced and computes the score. The tests read that state, not the commands you typed. dsoxlab check <lab>
  4. Progress Results are recorded on your machine. If you want them on your account on this site, sign in and push them, when the catalogue allows it. dsoxlab login / dsoxlab push

Install it with uv or pipx. No administrator rights are needed. uv tool install dsoxlab # or: pipx install dsoxlab Start a lab Install DSOXLab The DSOXLab course Source code on GitHub

Kinds of exercise

What you will practise playbooks and modulesinventoriesrolesVaultMoleculecollectionsexecution environments

Add this catalogue dsoxlab catalog add https://github.com/stephrobert/ansible-training 2 of 113 played and scored by the author, 111 not attested

Preparing the environment

1
  • Prepare Ansible managed nodes

    Guided lab beginner 25m virtual machines

    Converge the 5 managed node prerequisites (Python 3, SSH, NOPASSWD sudo, chrony, SELinux) with an idempotent bootstrap playbook.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start bootstrap-prepare-managed-nodes

Discovering Ansible

4
  • Declarative vs imperative: why Ansible does not drift

    Guided lab beginner 25m virtual machines

    Compare a Bash script that drifts on every run with a playbook that converges, and prove idempotence with changed=0 on the second pass.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start decouvrir-declaratif-vs-imperatif

  • Ansible installation: verify your control node

    Guided lab beginner 20m shell

    Identify your install method, check the 8 binaries on PATH, the modules reachable via ansible-doc and the collections the repo relies on.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start decouvrir-installation-ansible

  • ansible.cfg: precedence and critical options

    Guided lab beginner 30m virtual machines

    Write a project ansible.cfg, check the active config with ansible-config dump, override an option by environment variable and enable a callback.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start decouvrir-configuration-ansible

  • Ansible CLI: the 8 everyday commands

    Guided lab beginner 20m shell

    Chain ad-hoc runs, ansible-doc, ansible-config, ansible-inventory, ansible-galaxy, ansible-vault and ansible-lint across the lab.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start decouvrir-prise-en-main-cli

First steps

2
  • First playbook: install nginx on the webservers

    Guided lab beginner 30m virtual machines

    Write a 5-task playbook (dnf, systemd, firewalld), read the PLAY RECAP, capture output with register and check idempotence on the second pass.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start premiers-pas-premier-playbook

  • First steps with ansible-vault

    Guided lab beginner 45m virtual machines

    Encrypt a secrets file with ansible-vault, consume it through vars_files and protect output with no_log and a 0600 .vault_password.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start premiers-pas-ansible-vault

Writing Ansible code

28
  • Plays and tasks: anatomy and execution order

    Guided lab intermediate 40m virtual machines

    Structure a play with pre_tasks, tasks, post_tasks and handlers, then prove the real execution order with timestamped marker files.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-plays-et-tasks

  • handlers: the restart-on-config-change pattern

    Guided lab intermediate 35m virtual machines

    Notify several handlers, decouple them with listen, force meta: flush_handlers and pair validate so an invalid config is never applied.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-handlers

  • tags: target or skip a subset of tasks

    Guided lab intermediate 40m virtual machines

    Set tags, target with --tags and exclude with --skip-tags, inspect the plan via --list-tasks and use the special always and never tags.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-tags

  • check mode and diff: dry-run and change preview

    Guided lab intermediate 45m virtual machines

    Run a playbook with --check --diff, spot the modules that do not support check, force check_mode: false and diagnose a false changed positive.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-checkmode-diff

  • Variables: declaration and scope

    Guided lab beginner 40m virtual machines

    Declare variables with vars and vars_files, override them with --extra-vars and diagnose an unexpected value caused by YAML typing.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-variables-base

  • Collection types: lists, dicts, nested structures

    Guided lab intermediate 40m virtual machines

    Declare lists and lists of dicts in YAML, loop over them with loop_control: label, filter with when and reach nested fields.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-types-collections

  • facts and magic vars: ansible_facts, hostvars

    Guided lab intermediate 40m virtual machines

    Read system facts, use inventory_hostname, groups and hostvars, then cut the collection cost with gather_subset.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-facts-magic-vars

  • Custom facts: facts.d and ansible_local

    Guided lab intermediate 40m virtual machines

    Drop an INI custom fact then an executable script returning JSON into /etc/ansible/facts.d, and read them back through ansible_local.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-custom-facts

  • Variable precedence: the 22 levels

    Guided lab advanced 55m virtual machines

    Stack the same variable at several levels to demonstrate which one wins, from role defaults up to --extra-vars.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-precedence-variables

  • register and set_fact: capture and create variables

    Guided lab intermediate 40m virtual machines

    Capture module output with register, reuse it in when and loop, create a runtime fact and persist it with cacheable: true.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-register-set-fact

  • Parallelism: forks, serial, throttle, strategy

    Guided lab advanced 50m virtual machines

    Tell forks from serial, run a rolling update with serial: 1, compare the linear and free strategies and rate-limit a single task with throttle.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-parallelisme-strategies

  • async and poll: long tasks without blocking SSH

    Guided lab advanced 45m virtual machines

    Detach a long task with async + poll: 0, collect its result via async_status, poll actively with until and diagnose an orphaned job.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-async-poll

  • Delegation: delegate_to, run_once, local_action

    Guided lab advanced 45m virtual machines

    Redirect a task to another host, run it only once in a multi-host play and target the control node with local_action.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-delegation

  • lookups: fetch external data at runtime

    Guided lab intermediate 40m virtual machines

    Read a file, an environment variable or a command output on the control node, generate a password and tell lookup from query.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-lookups

  • Jinja2: interpolation, logic and whitespace

    Guided lab intermediate 45m virtual machines

    Interpolate variables, loop and branch inside a template, then kill stray blank lines with whitespace control.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-jinja2-base

  • Essential Jinja2 filters: default, combine, selectattr

    Guided lab intermediate 45m virtual machines

    Handle missing variables with default, work on lists, filter a list of dicts with selectattr and map, merge dicts with combine.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-filtres-jinja-essentiels

  • when conditions: operators and Jinja tests

    Guided lab intermediate 40m virtual machines

    Gate a task on a fact, combine several conditions, test whether a variable is defined and diagnose a when that matches wrongly.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-conditions-when

  • loop: iterate over lists and dicts

    Guided lab intermediate 40m virtual machines

    Loop over a list and a list of dicts, keep console output readable with loop_control: label, iterate a dict with dict2items.

    Graded on the state of the system attested 30 Oct 2026

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-boucles-loop

  • Legacy with_* loops: migrating to loop

    Guided lab intermediate 45m virtual machines

    Recognise with_items, with_dict and with_subelements, migrate them to loop plus Jinja2 filters and automate it with ansible-lint --fix.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-boucles-with-deprecated

  • block, rescue, always: try/catch/finally

    Guided lab intermediate 40m virtual machines

    Group tasks in a block, catch the error with rescue to roll back, guarantee cleanup with always and read ansible_failed_task.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-block-rescue-always

  • failed_when and changed_when: redefine success and change

    Guided lab intermediate 40m virtual machines

    Neutralise changed on read-only commands, define changed_when from output and accept some return codes as success.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-failed-when-changed-when

  • ignore_errors: legitimate use vs anti-pattern

    Guided lab intermediate 40m virtual machines

    Measure the effect of ignore_errors on the PLAY RECAP, spot its few legitimate cases and prefer failed_when or block/rescue.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-ignore-errors

  • any_errors_fatal: stop the play on the first error

    Guided lab advanced 50m virtual machines

    Enable any_errors_fatal on a multi-host play, compare it with the default and with max_fail_percentage, and combine it with serial.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-any-errors-fatal

  • Advanced Jinja2 filters: regex, b64, password_hash

    Guided lab advanced 50m virtual machines

    Extract with regex_search, encode to base64, hash a password with sha512, query JSON with json_query and handle IPs and CIDRs.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-filtres-jinja-avances

  • Jinja2 tests: is defined, is mapping, is sequence

    Guided lab intermediate 40m virtual machines

    Test a variable's definition and type, match a regex with is match and is search, and combine those tests in when and in {% if %}.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-tests-jinja

  • template module: validate, backup, whitespace

    Guided lab intermediate 45m virtual machines

    Render a config from a Jinja2 template, reject invalid syntax with validate, back up the previous file and set mode, owner and group.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-module-template

  • lineinfile vs template: which module when

    Guided lab intermediate 40m virtual machines

    Arbitrate between lineinfile, blockinfile and template, combine base plus overrides and diagnose a lineinfile that stacks for lack of a regexp.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-lineinfile-vs-template

  • import vs include: static or dynamic

    Guided lab advanced 45m virtual machines

    Choose between import_* parsed at start and include_* resolved at runtime, and observe how tags and when behave differently in each case.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start ecrire-code-import-include

File modules

7
  • copy module: transfer files and inline content

    Guided lab beginner 35m virtual machines

    Transfer a file with src: or write inline content with content:, mastering mode, owner, backup and validate.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-fichiers-copy

  • file module: states, permissions and symlinks

    Guided lab beginner 30m virtual machines

    Manage the state of a file or directory (directory, absent, link, hard, touch), recursive permissions and symbolic links.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-fichiers-file

  • blockinfile module: idempotent multi-line block

    Guided lab beginner 30m virtual machines

    Insert and maintain a multi-line block in an existing file with custom markers, insertafter/insertbefore and idempotence.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-fichiers-blockinfile

  • lineinfile module: edit a line in an existing file

    Guided lab beginner 25m virtual machines

    Add, replace by regexp or remove a line in a config file, using backrefs and syntax validation before the write.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-fichiers-lineinfile

  • replace module: substitute a pattern in a file

    Guided lab intermediate 35m virtual machines

    Substitute a regex pattern throughout a file, scope it with before/after, and preserve parts of it with capture groups.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-fichiers-replace

  • fetch module: retrieve files from managed nodes

    Guided lab beginner 35m virtual machines

    Collect logs and configs from managed nodes to the control node, per-host tree or flat mode with inventory_hostname.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-fichiers-fetch

  • archive and unarchive modules: compress and extract

    Guided lab beginner 30m virtual machines

    Create a tar.gz archive on the managed node and extract local, remote or already-present tarballs idempotently with creates.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-fichiers-archive-unarchive

Package modules

3
  • package module: distro-agnostic installation

    Guided lab beginner 30m virtual machines

    Install and remove packages without depending on the distro package manager, weighing state: present against state: latest.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-paquets-package

  • dnf module: enablerepo, security, exclude, autoremove

    Guided lab advanced 45m virtual machines

    Enable a repo on the fly, patch CVEs only, exclude the kernel from a bulk upgrade and clean up orphaned dependencies.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-paquets-dnf-options

  • yum_repository module: declare an RPM repository

    Guided lab intermediate 35m virtual machines

    Declare a yum/dnf repository with gpgcheck, import its GPG key via rpm_key, and disable a repo without removing it.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-paquets-yum-repository

Service modules

2
  • systemd_service module: manage systemd services

    Guided lab beginner 35m virtual machines

    Start, enable, reload and mask services, drop a custom unit file with daemon_reload, and notify a service from a handler.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-services-systemd

  • cron module: schedule idempotent jobs

    Guided lab beginner 30m virtual machines

    Schedule idempotent cron jobs via a user crontab or /etc/cron.d, with environment variables and clean disabling.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-services-cron

User modules

4
  • user module: create, modify and remove accounts

    Guided lab beginner 35m virtual machines

    Create accounts with home, shell and secondary groups, hash a password, force a specific UID, and remove an account with its home.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-utilisateurs-user

  • group module: manage Linux groups

    Guided lab beginner 30m virtual machines

    Create groups with a forced GID, tell system groups from user groups, and order group creation before the users that reference it.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-utilisateurs-group

  • authorized_key module: user SSH keys

    Guided lab beginner 35m virtual machines

    Provision public SSH keys, force an exclusive list, restrict a key with key_options, and handle several users with subelements.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-utilisateurs-authorized-key

  • sudoers module: manage sudo rights safely

    Guided lab advanced 50m virtual machines

    Create rules under /etc/sudoers.d/ with automatic visudo validation, limit allowed commands, and handle nopassword on a group.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-utilisateurs-sudoers

RHEL modules

7
  • firewalld module: manage the RHEL firewall

    Guided lab beginner 30m virtual machines

    Allow predefined services and custom ports per zone, with the permanent + immediate trap and the firewall reload.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-rhel-firewalld

  • sysctl module: persisted kernel parameters

    Guided lab intermediate 40m virtual machines

    Change kernel parameters (ip_forward, tcp_syncookies, swappiness) with immediate effect and persistence through /etc/sysctl.d/.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-rhel-sysctl

  • selinux module: modes, booleans and contexts

    Guided lab advanced 55m virtual machines

    Switch SELinux to enforcing, flip a boolean persistently, and set a custom context with sefcontext followed by restorecon.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-rhel-selinux

  • mount module: manage fstab and mount points

    Guided lab intermediate 45m virtual machines

    Handle the 5 mount states, mount a loop device, set noatime/nodev/nosuid options, and make a mount survive a reboot.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-rhel-mount

  • parted module: create a disk partition

    Guided lab intermediate 35m virtual machines

    Create aligned MBR or GPT partitions idempotently, set flags (lvm, boot, esp), and inspect the existing partition table.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-rhel-parted

  • filesystem module: create a filesystem

    Guided lab intermediate 35m virtual machines

    Format partitions as ext4 and xfs, pick the right fstype for the use case, and force a rebuild with force: true.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-rhel-filesystem

  • LVM: chaining lvg, lvol, filesystem and mount

    Guided lab advanced 50m virtual machines

    Build a PV, VG and LV on a spare disk, format it, mount it through fstab, and grow it online with resizefs.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-rhel-lvm-storage

Network modules

2
  • get_url module: download a file over HTTP/HTTPS

    Guided lab beginner 35m virtual machines

    Download a file onto the managed node idempotently, check its integrity with a sha256 checksum, and authenticate the request.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-reseau-get-url

  • uri module: REST API calls

    Guided lab advanced 50m virtual machines

    Call a REST API with GET/POST and a JSON body, accept several status_code values, and loop a healthcheck with until/retries.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-reseau-uri

Diagnostic modules

4
  • stat module: inspect files and directories

    Guided lab beginner 30m virtual machines

    Check existence, type, size, mode and checksum of a file without modifying it, to drive conditional logic.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-diagnostic-stat

  • find module: multi-file search

    Guided lab beginner 30m virtual machines

    Search files by glob, regex, age, size and type, then chain loop and file for a targeted, idempotent cleanup.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-diagnostic-find

  • assert and fail modules: defensive validation

    Guided lab intermediate 40m virtual machines

    Validate prerequisites at the start of a play, customize fail_msg and success_msg, and fail explicitly on an error branch.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-diagnostic-assert-fail

  • wait_for and pause modules: synchronization

    Guided lab intermediate 35m virtual machines

    Wait for a TCP port to open or close, for a file or a regex to appear, and add a timed or interactive pause.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start modules-diagnostic-wait-for-pause

Inventories

4
  • Write a static inventory from scratch: groups, children and group vars

    Guided lab beginner 40m virtual machines

    Author an Ansible static inventory by hand: declare host groups, a parent group with children, and group variables, then prove the resolved inventory with ansible-inventory and ansible -m ping.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start inventaires-statiques

  • group_vars and host_vars: structured inventory variables

    Guided lab beginner 30m virtual machines

    Spread inventory variables across all, group and host levels, then check the resolved value with ansible-inventory --host.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start inventaires-group-vars-host-vars

  • Host patterns: wildcards and the :, & and ! operators

    Guided lab intermediate 35m virtual machines

    Target exactly the hosts you want with --limit and the union, intersection and exclusion operators, without touching the playbook.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start inventaires-patterns-hotes

  • Dynamic KVM inventory with community.libvirt

    Guided lab intermediate 35m virtual machines

    Discover libvirt VMs automatically through the inventory plugin, build Jinja groups and keyed_groups, with no manual inventory.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start inventaires-dynamique-kvm

Roles

7
  • Create your first role with ansible-galaxy role init

    Guided lab beginner 45m virtual machines

    Scaffold a webserver role, fill in tasks, defaults, handlers and meta, then call it from a playbook with roles:.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start roles-creer-premier-role

  • Role variables: defaults/ vs vars/ and precedence

    Guided lab intermediate 35m virtual machines

    Split variables between defaults/ (overridable) and vars/ (internal), wire them into tasks and a Jinja2 template, then verify precedence.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start roles-variables-defaults-vars

  • Role handlers and meta: notify and galaxy_info

    Guided lab intermediate 40m virtual machines

    Write several handlers (service and non-service), trigger them with notify, choose between restarted and reloaded, then complete meta/main.yml for Galaxy.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start roles-handlers-meta

  • argument_specs: validate a role's input variables

    Guided lab intermediate 50m virtual machines

    Write meta/argument_specs.yml to type, constrain and document input variables, then watch an invalid input get rejected automatically.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start roles-argument-specs

  • Consume a role: roles:, import_role, include_role

    Guided lab intermediate 50m virtual machines

    Call the same role three different ways and choose between static and dynamic, especially once a when: is involved.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start roles-consommer-role

  • Role dependencies via meta/main.yml

    Guided lab intermediate 45m virtual machines

    Chain roles with dependencies:, pass them variables, control execution order and dodge the diamond trap with allow_duplicates.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start roles-dependencies

  • RHEL system roles: converge time synchronisation with timesync

    Guided lab advanced 1h virtual machines

    Consume a vendor role from linux-system-roles: drive chronyd on db1.lab through timesync variables, never writing chrony.conf by hand.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start roles-system-roles

Testing with Molecule

4
  • Molecule: anatomy of a test scenario

    Guided lab advanced 45m shell

    Read a molecule/default/ scenario: molecule.yml, converge.yml, verify.yml, driver, platforms, verifier, then run the full cycle.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start molecule-introduction

  • Molecule: enrich a scenario beyond the defaults

    Guided lab intermediate 35m shell

    Add prepare.yml and requirements.yml, tune instances through host_vars, define a test_sequence including idempotence and enable profile_tasks.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start molecule-installation-config

  • Molecule: build a users role test-first

    Guided lab advanced 45m shell

    Write verify.yml and argument_specs.yml before a single task, then iterate on converge until green and refactor without breaking the tests.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start molecule-tdd-cycle

  • Molecule: test a role across distributions

    Guided lab advanced 45m shell

    Extend the Molecule matrix to three distributions, load vars/<os_family>.yml and absorb package and path gaps with the package module.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start molecule-scenarios-multi-distro

Python tests and linting

3
  • Molecule + testinfra: Python assertions on a role

    Guided lab advanced 40m shell

    Switch the verifier to testinfra, write assertions with the host fixture, parametrize cases, and weigh it against verify.yml.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start tests-testinfra

  • tox: test a role against several ansible-core versions

    Guided lab advanced 40m shell

    Write a tox.ini that pins one ansible-core version per environment and runs molecule test across the whole matrix in a single command.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start tests-tox-multiversion

  • ansible-lint production profile with pre-commit

    Guided lab advanced 40m shell

    Configure .ansible-lint on the production profile plus a strict .yamllint, then wire both into pre-commit with a secret-leak hook.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start tests-ansible-lint-production

Continuous integration

2
  • GitHub Actions: CI workflow for a role

    Guided lab advanced 40m shell

    Write a lint + molecule workflow with a distro x ansible-core matrix, pip caching, least-privilege permissions and persist-credentials disabled.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start ci-github-actions

  • GitLab CI: parallel:matrix pipeline for a role

    Guided lab advanced 40m shell

    Write a .gitlab-ci.yml with lint, test and release stages, spread the matrix with parallel:matrix and restrict Galaxy publishing to Git tags via rules:.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start ci-gitlab

Galaxy and publishing

4
  • ansible-galaxy CLI: init, install, list, build, publish

    Guided lab beginner 20m shell

    Init a role and a collection, install from Galaxy or Git, list what is present, build a tarball and publish it with an API token.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start galaxy-ansible-galaxy-cli

  • Install roles and collections from Galaxy or Git

    Guided lab intermediate 30m shell

    Write a requirements.yml mixing Galaxy roles, Git sources and collections, pin every version and vendor a role into the project for reproducible installs.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start galaxy-installer-roles

  • Audit a Galaxy role before adopting it

    Guided lab advanced 40m shell

    Score a third-party role on six axes (maintainer, quality, security, tests), spot the anti-patterns and decide: adopt, fork or reject.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start galaxy-auditer-role-existant

  • Version and publish a role: semver, Git tags, Galaxy

    Guided lab advanced 35m shell

    Apply semver to a role, keep a CHANGELOG.md, cut an annotated Git tag and automate Galaxy publishing from CI.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start galaxy-versionner-publier

Ansible Vault

7
  • Ansible Vault: encrypt your first secrets file

    Guided lab beginner 35m virtual machines

    Encrypt a YAML file with ansible-vault, view it, edit it, consume it from a playbook, then rekey and decrypt it.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start vault-introduction

  • encrypt_string vs whole-file encryption

    Guided lab intermediate 45m virtual machines

    Encrypt a single value with encrypt_string, mix it with plaintext variables via the !vault tag, and choose between inline and whole-file.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start vault-chiffrer-fichier-variable

  • Multiple vault-ids: isolate dev, staging and prod

    Guided lab intermediate 45m virtual machines

    Encrypt each environment with a labelled vault-id, decrypt several vault-ids in a single run and lay out group_vars per environment.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start vault-id-multiples

  • Mixed playbooks: main.yml plus vault.yml per group

    Guided lab intermediate 50m virtual machines

    Split public variables from secrets inside each group_vars, adopt the vault_* convention, and confirm Ansible merges both files transparently.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start vault-playbooks-mixtes

  • Vault inside a role: plaintext defaults, encrypted vars

    Guided lab intermediate 50m virtual machines

    Expose public variables in defaults/main.yml pointing to vault_* values in an encrypted vars/main.yml, and override them from the playbook.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start vault-dans-roles

  • Fetch secrets from HashiCorp Vault or OpenBao

    Guided lab advanced 50m shell

    Start a local Vault, store a secret in it, read it from Ansible with community.hashi_vault, and compare token, AppRole and JWT authentication.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start vault-integration-hashicorp

  • Fetch secrets from Passbolt

    Guided lab intermediate 40m shell

    Start a local Passbolt CE, authenticate with an OpenPGP key, read a secret from Ansible and compare the Passbolt model with HashiCorp Vault.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start vault-integration-passbolt

Execution environments

5
  • First run inside an Execution Environment

    Guided lab intermediate 40m shell

    Pull an EE image with Podman, set it as the default in ansible-navigator.yml, run a playbook inside it and compare with a plain ansible-playbook run.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start ee-hello

  • Inspect an Execution Environment and pick the right one

    Guided lab intermediate 30m shell

    List an EE's contents with ansible-navigator, compare community-ansible-dev-tools, awx-ee and community-ee-minimal, then pick one per use case.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start ee-inspection

  • Build a custom EE with ansible-builder v3

    Guided lab advanced 55m shell

    Write a v3 execution-environment.yml, pin ansible-core and dependencies, build with Podman, test the image and push it to a private registry.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start ee-builder-custom

  • CI/CD pipeline for Execution Environments

    Guided lab advanced 55m shell

    Build an EE in CI, scan it with Trivy in blocking mode, sign it with keyless cosign and publish it, with SHA-pinned actions and least-privilege permissions.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start ee-ci-pipeline

  • Debug a broken Execution Environment

    Guided lab advanced 40m shell

    Diagnose an EE that builds cleanly yet ships empty: forgotten schema version, missing collection or PyPI version, then fix it and verify.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start ee-debug

Troubleshooting

3
  • Verbosity levels and callback plugins

    Guided lab intermediate 40m virtual machines

    Pick the -v level that matches the symptom, enable profile_tasks and YAML output (callback_result_format), and see what a missing no_log leaks.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start troubleshooting-verbosite

  • Interactive debugger: debugger: on_failed

    Guided lab advanced 50m virtual machines

    Enable the debugger on failure, inspect task, task_vars and result in the REPL, patch arguments on the fly then replay the task with redo.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start troubleshooting-debugger

  • Fix broken idempotence and tune performance

    Guided lab advanced 50m virtual machines

    Make a shell task idempotent with creates or changed_when, measure a baseline with profile_tasks, then tune pipelining and forks (ControlPersist is already on by default).

    Graded on the state of the system attested 30 Oct 2026

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start troubleshooting-idempotence-perfs

Collections

6
  • Explore Ansible collections: FQCN and structure

    Guided lab advanced 50m virtual machines

    List and inspect installed collections, read a galaxy.yml, walk the plugins/roles/playbooks layout and track down a module by its FQCN.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start collections-decouvrir

  • Automation content navigator: discover a module in a collection and use it

    Guided lab advanced 45m virtual machines

    Use ansible-navigator to find a module inside an installed collection, apply it to produce a verifiable kernel state on db1.lab, and validate an inventory with ansible-navigator inventory.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start collections-navigator

  • requirements.yml: multi-source install with GPG signatures

    Guided lab intermediate 45m virtual machines

    Declare four sources in a requirements.yml, pin every version, check integrity with collection verify and target several Galaxy servers.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start collections-requirements

  • Build your own collection with a custom Python module

    Guided lab advanced 55m shell

    Init a collection, fill in galaxy.yml and meta/runtime.yml, add a role and a documented Python module, then build the tarball.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start collections-creer-custom

  • CI matrix for a collection: ansible-core x Python

    Guided lab advanced 45m shell

    Cross ansible-core and Python versions in a matrix, run ansible-test sanity and units in containers, and pin every action by SHA.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start collections-ci-tests

  • Migrate a standalone role to a collection

    Guided lab advanced 1h virtual machines

    Move a role and its custom module into a collection, set up plugin_routing.redirect, and check the old name still works with a warning.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start collections-migration-role

Advanced practices

2
  • Version your playbooks with Git

    Guided lab beginner 25m shell

    Initialize a Git repository for your playbooks, track and commit them, then push to a local bare remote: the exact EX294 gesture, with no forge to set up.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start pratiques-versionner-git

  • ansible-pull: GitOps and Edge pattern

    Guided lab advanced 50m virtual machines

    Run ansible-pull against a Git repository, schedule it with cron or a systemd timer, bootstrap it from cloud-init, then choose push or pull per use case.

    Graded on the state of the system not attested

    Open the guide (French)

    Command to start it

    dsoxlab start pratiques-ansible-pull-gitops

RHCE EX294 exam

2
  • RHCE EX294 mock exam: 19 tasks in 4 hours

    Capstone advanced 4h virtual machines

    Work through 19 timed tasks covering inventories, variables, vault, files, packages, services, roles, error handling, rolling waves, delegation, tags, scheduled jobs, custom facts and content collections, each validated by pytest.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start rhce-mock-ex294

  • Mock RHCE EX294 #2

    Capstone advanced 4h virtual machines

    A second full timed EX294 mock: the same 19 categories as mock #1, but every concrete value differs (Apache/valkey stack, different users, LVM layout, ports, SELinux boolean, cron schedule, collection), so nothing can be copied from memory. Each task is proven by pytest.

    Graded on the state of the system not attested

    Open the guide (French) RHCE

    Command to start it

    dsoxlab start rhce-mock-ex294-2