EasyEnv
Ansible
Intermediate

Ansible

Learn Ansible from first inventory to multi-host deployments. Playbooks, roles, templates, vault, and idempotent automation.

12 lessons6.1h hands-on11 languages
Start learning freeAnsible course

12 lessons, in order

  1. 1

    What Is Ansible

    Welcome. If you have never automated a server in your life, you are in the right place. Before we run anything, we are going to get a clear picture...

    Configuration managementAgentless automationIdempotencyControl nodeManaged nodesPlaybooks vs scripts
    20 min
  2. 2

    Inventory and Ad Hoc Commands

    You now know Ansible connects to machines over SSH and describes desired state instead of steps. But before Ansible can talk to anything, it needs an...

    Inventory fileHost groupsAd hoc commandsAnsible pingAnsible -mAnsible -a
    25 min
  3. 3

    Your First Playbook

    Ad hoc commands are great for a quick check or a one-off fix, but they do not scale to a real setup. You would need to remember and retype the exact...

    Playbook structurePlaysHostsTasksBecomeAnsible-playbook command
    30 min
  4. 4

    Tasks, Modules, and Handlers

    Picture a playbook that manages a web server. It has three tasks that each touch a different config file, and after any of them changes, the service...

    TasksModulesHandlersNotifyChanged_whenService restart pattern
    30 min
  5. 5

    Variables and Facts

    Write a playbook with the port number, the site name, and the package versions typed directly into the tasks, and it works, once, on the one machine...

    Variables in playbooksVars filesGroup_varsHost_varsFactsVariable precedence basics
    30 min
  6. 6

    Templates with Jinja2

    Copying a static file to every machine works fine right up until one machine needs a different port number, a different hostname, or a config block...

    Template moduleJinja2 expressionsFiltersIf blocks in templatesFor loops in templates
    30 min
  7. 7

    Loops and Conditionals

    A playbook that installs one package has one task. A playbook that installs ten packages should not have ten nearly identical tasks that differ only...

    Loop keywordLoop with dictsWhen conditionalsRegisterBlock and rescue basics
    30 min
  8. 8

    Roles and Galaxy

    Sooner or later you end up with two playbooks that both install nginx, both drop the same config template, and both restart the service afterward,...

    Role structureTasks/main.ymlDefaultsTemplates folderInclude_roleAnsible-galaxy install
    35 min
  9. 9

    Vault and Secrets

    Everything you have written so far has been safe to show anybody. Inventories, templates, role defaults: none of it would hurt you if a stranger read...

    Ansible-vault encryptAnsible-vault editVault password fileEncrypted variablesVault id labels
    25 min
  10. 10

    Tags and Debugging

    Your playbook started at six tasks and you ran it constantly. Now it is fifty tasks across four roles, it takes three minutes, and you are editing...

    Tags on tasks and roles--tags and --skip-tags--start-at-taskVerbose flagsDebug moduleAnsible-playbook --check --diff
    25 min
  11. 11

    Collections and Plugins

    Every module name in this course has carried a prefix you may have been quietly ignoring: ansible.builtin.copy, ansible.builtin.template,...

    CollectionsFQCNAnsible-galaxy collection installRequirements.yml for collectionsFilter plugins overviewLookup plugins overview
    25 min
  12. 12

    Capstone: Multi Host Deploy

    Every lesson so far taught one piece in isolation: an inventory here, a role there, a template, a vault file, a handful of tags. That is how you...

    Multi-play playbooksRoles in productionGroup_vars by environmentVault for secretsSerial and rolling updatesPutting it all together
    60 min
Ansible Course: Hands-on, in 11 Languages | Engineering Courses