Spin up a local Ansible practice lab without provisioning real VMs
Test the same playbook against both Ubuntu 22.04 and Red Hat UBI 9 targets
Practice ansible-vault with the bundled vault.secret and encrypted values
Edit playbooks in the browser via code-server and run them from the same terminal
Requires Docker and Docker Compose installed locally; default vault password is devops for the bundled examples.
Ansible-HandsOn is a small practice lab for learning Ansible. Ansible is a tool that lets you automate work on servers, such as installing software, copying files, or running commands, by writing the steps in plain text files called playbooks. To learn it, you normally need several Linux machines to practice on. This project gives you that practice setup on your own computer using Docker containers instead of full virtual machines, so it starts in seconds and stays light on memory. The lab has three containers that talk to each other on a private Docker network. The first is the controller, called ansible_controller, which has Python, Ansible itself, and a browser-based code editor called code-server reachable at port 8080. The other two are pretend target servers: ansible_worker1 runs Ubuntu 22.04 and ansible_worker2 runs Red Hat UBI 9. Both workers have OpenSSH and Python installed so the controller can connect to them over SSH and run Ansible tasks. The repo also ships a .config/ folder with the configuration files needed to make Ansible work out of the box. ansible.cfg sets the inventory location, points to a Vault password file, and turns off host key checking, which is fine inside a throwaway Docker network. inventory.yaml lists pretend server groups named prod, dev, and testing. vault.secret holds the default Vault password, which is devops, and is used to encrypt sensitive values. There are also small config files for ansible-lint, yamllint, and pymarkdown, plus a requirements.txt that pins the Python packages installed in the controller. Starting the lab is one command, docker compose up -d, using the compose file shown in the README. The three containers come up together. You then open http://localhost:8080 in a browser to land in the code-server editor, where you can edit files and open a terminal. From that terminal you run ansible-playbook against the playbooks in the repo, for example ansible-playbook playbooks/host_information.yaml. There is a nice touch for the live-edit loop: a process called inotifywait watches the .config/ folder, and when you change a file there, a script named update_config.sh runs automatically to apply the new settings, so you do not have to restart anything by hand.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.