{"id":25931100,"url":"https://github.com/shantoroy/ansible-mini-docker-lab","last_synced_at":"2026-05-02T11:42:36.209Z","repository":{"id":280187746,"uuid":"939716035","full_name":"shantoroy/ansible-mini-docker-lab","owner":"shantoroy","description":"This project demonstrates Ansible configuration management in a local Docker environment, featuring one Ansible control node and two managed nodes.","archived":false,"fork":false,"pushed_at":"2025-03-01T20:09:22.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T21:19:51.401Z","etag":null,"topics":["ansible","ansible-playbook","configuration-management","docker","docker-compose"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shantoroy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T01:42:54.000Z","updated_at":"2025-03-01T20:12:22.000Z","dependencies_parsed_at":"2025-03-01T21:30:00.756Z","dependency_job_id":null,"html_url":"https://github.com/shantoroy/ansible-mini-docker-lab","commit_stats":null,"previous_names":["shantoroy/ansible-mini-docker-lab"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Fansible-mini-docker-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Fansible-mini-docker-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Fansible-mini-docker-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Fansible-mini-docker-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shantoroy","download_url":"https://codeload.github.com/shantoroy/ansible-mini-docker-lab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241758972,"owners_count":20015247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-playbook","configuration-management","docker","docker-compose"],"created_at":"2025-03-03T23:57:32.890Z","updated_at":"2026-05-02T11:42:36.204Z","avatar_url":"https://github.com/shantoroy.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Docker Demo\n\nThis project demonstrates Ansible configuration management using Docker containers. It consists of one Ansible control node and two managed nodes, all running in Docker containers orchestrated with Docker Compose.\n\n## Prerequisites\n\n- Docker and Docker Compose installed on your local machine\n- Git for version control\n\n## Getting Started\n\n1. Clone this repository\n   ```bash\n   git clone https://github.com/shantoroy/ansible-docker-mini-lab.git\n   cd ansible-docker-demo\n   ```\n\n2. Generate SSH keys for passwordless authentication\n   ```bash\n   ssh-keygen -t rsa -f id_rsa -N \"\"\n   ```\n\n3. Start the Docker containers\n   ```bash\n   docker-compose up -d\n   ```\n\n4. Log into the Ansible control node\n   ```bash\n   docker exec -it ansible-master bash\n   ```\n\n5. Inside the container, test the connection to managed nodes\n   ```bash\n   ansible all -m ping\n   ```\n\n## Running Playbooks\nRun the main playbook to configure all nodes\n\n```bash\nansible-playbook playbooks/site.yml\n```\n\nOr run specific playbooks for targeted configuration\n\n```bash\nansible-playbook playbooks/webserver.yml\nansible-playbook playbooks/database.yml\nansible-playbook playbooks/security.yml\n```\n\n## Project Structure\n\n```\nansible-docker-demo/\n├── docker-compose.yml         # Docker Compose configuration\n├── Dockerfile.ansible         # Dockerfile for Ansible control node\n├── Dockerfile.node            # Dockerfile for managed nodes\n├── README.md                  # Project documentation\n├── ansible.cfg                # Ansible configuration file\n├── inventory/\n│   └── hosts                  # Inventory file\n├── playbooks/\n│   ├── site.yml               # Main playbook\n│   ├── webserver.yml          # Web server configuration\n│   ├── database.yml           # Database configuration\n│   └── security.yml           # Security hardening playbook\n└── roles/\n    ├── common/                # Common configuration role\n    │   ├── tasks/\n    │   │   └── main.yml\n    │   └── handlers/\n    │       └── main.yml\n    ├── webserver/             # Web server role\n    │   ├── tasks/\n    │   │   └── main.yml\n    │   ├── templates/\n    │   │   └── nginx.conf.j2\n    │   └── handlers/\n    │       └── main.yml\n    └── database/              # Database role\n        ├── tasks/\n        │   └── main.yml\n        ├── templates/\n        │   └── my.cnf.j2\n        └── handlers/\n            └── main.yml\n```\n\n* **docker-compose.yml**: Defines the Docker containers\n* **Dockerfile.ansible**: Configuration for the Ansible control node\n* **Dockerfile.node**: Configuration for the managed nodes\n* **ansible.cfg**: Ansible configuration file\n* **inventory/hosts**: Inventory file defining managed nodes\n* **playbooks/**: Contains all Ansible playbooks\n* **roles/**: Contains role definitions for different server types\n\n\n## Implemented Features\nThis project demonstrates:\n\n* Infrastructure as code with Docker Compose\n* Password-less SSH authentication\n* Role-based configuration management\n* Web server and database server setup\n* Security hardening best practices\n* Templates for configuration files\n* Handlers for service management\n\n## Extending the Project\nExtend this project by:\n\n* Adding more managed nodes\n* Creating additional roles for different server types\n* Implementing environment-specific configurations\n* Adding monitoring and logging configurations\n* Creating CI/CD pipelines for testing ansible playbooks","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshantoroy%2Fansible-mini-docker-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshantoroy%2Fansible-mini-docker-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshantoroy%2Fansible-mini-docker-lab/lists"}