A small, role-based local Ansible environment using Docker, designed for quick experimentation and easy re-use.
The structure used matches typical real-world Ansible projects.
The sandbox includes an example Ansible playbook that deploys a local webserver inside a Docker container.
You don’t need any Ansible knowledge to use this sandbox.
Before running anything, you must complete the following:
-
Ensure Docker Desktop is running The sandbox deploys everything into a local Docker container.
-
Rename
.env_template→.env, then add your GitHub PAT inside it:GIT_PAT_TOKEN=ghp_your_real_token_here
After completing the prerequisites, run the following commands from the repo root:
make deps # install Ansible
make install # create the Docker container
make run # apply the example playbookThen visit http://localhost in your browser → You’ll see a test page served from inside the container.
The example playbook applies two roles to a local Docker container:
webserver→ installs nginx and serves a simple “Hello” pagegit_repo_dbt→ installs git and clones the privateda-etl-dbtanalyticsrepo using a PAT
The result:
- nginx running inside the container
- the dbt analytics repo cloned under
/opt
-
make installcreates an Ubuntu Docker container (sandbox_webserver), exposes port 80 → host, installs Python. -
make runauto-loads.env, providingGIT_PAT_TOKENto Ansible. -
nginx + the cloned repo sit inside the container, not on your machine
-
Ansible applies:
- webserver → installs nginx and serves a test HTML page
- git_repo_dbt → clones the private repo into
/opt
-
You visit http://localhost to see the nginx page from inside the container.