Sign inSign up free

1252. An Inventory That Can't Reach Anyone

easy 10 XP ~8 minHands-on lab

A colleague started an inventory for the shop's servers in /home/student/ansible/inventory.ini, but ansible all -m ping fails and the playbooks can't find their groups.

The servers are web1, web2 (web servers) and db1 (database). They are reachable over ssh as root from this machine.

Task

Fix /home/student/ansible/inventory.ini (the project's ansible.cfg already points to it) so that:

  1. Group web holds exactly web1 and web2, and group db holds exactly db1.
  2. Group shop has web and db as its child groups.
  3. Every host in web has the variable http_port set to 8080; db1 doesn't have it.
  4. ansible shop -m ping, run from /home/student/ansible, succeeds for all three hosts.

About this machine

Ubuntu 24.04 with no internet access and ansible-core installed. Three managed hosts sit next to it: web1, web2 and db1, separate machines with systemd and Python, reached over ssh as root. Only the ansible.builtin modules are available, and nothing can be downloaded. The grader runs your playbooks and checks the hosts' final state, not the commands you typed.

Part of Ansible from Zero. Next step: shell or a Module?

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.