A complete Infrastructure as Code implementation for CI/CD infrastructure management using Terraform and Ansible.
This repository demonstrates enterprise-grade Infrastructure as Code practices by managing a complete CI/CD infrastructure stack:
- 🔗 Gitea: Self-hosted Git repository management (Port 3000)
- ⚙️ Jenkins: Continuous Integration/Continuous Deployment (Port 8080)
- 🐳 Portainer: Docker container management interface (Port 9000)
┌─────────────────────────────────────────────────────────────┐ │ Infrastructure as Code │ ├─────────────────────────────────────────────────────────────┤ │ Terraform │ Ansible │ Docker │ │ ├─ Infrastructure │ ├─ Configuration │ ├─ Services │ │ ├─ State Mgmt │ ├─ Monitoring │ ├─ Networks │ │ └─ Multi-Env │ └─ Automation │ └─ Volumes │ └─────────────────────────────────────────────────────────────┘
infrastructure-as-code-lab/ ├── terraform/ # Infrastructure as Code │ ├── main.tf # Main Terraform configuration │ └── scripts/ # Helper scripts │ └── tf-helper.sh └── ansible/ # Configuration Management ├── playbooks/ # Automation playbooks │ └── site.yml # Main infrastructure playbook ├── inventory/ # Server inventory │ └── hosts.yml # Infrastructure inventory ├── ansible.cfg # Ansible configuration └── ansible-helper.sh
- Ubuntu 24.04 LTS
- Docker & Docker Compose
- Terraform v1.9.4+
- Ansible v2.16+
- Clone the repository
git clone https://github.com/AndrewBz512/infrastructure-as-code-lab.git
cd infrastructure-as-code-lab
Deploy infrastructure with Terraform
bashcd terraform
terraform init
terraform plan
terraform apply
Configure and monitor with Ansible
bashcd ../ansible
ansible-playbook playbooks/site.yml
🌐 Service Access
Once deployed, access your services at:
🔗 Gitea: http://192.168.1.26:3000
⚙️ Jenkins: http://192.168.1.26:8080
🐳 Portainer: http://192.168.1.26:9000
📊 Current Status
All services operational:
✅ Gitea: UP (Port 3000)
✅ Jenkins: UP (Port 8080)
✅ Portainer: UP (Port 9000)
📄 License
This project is licensed under the MIT License.
Built with ❤️ for the Infrastructure as Code community