Skip to content

AndrewBz512/infrastructure-as-code-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrastructure as Code Lab 🏗️

License: MIT Terraform Ansible

A complete Infrastructure as Code implementation for CI/CD infrastructure management using Terraform and Ansible.

🎯 Project Overview

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)

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐ │ Infrastructure as Code │ ├─────────────────────────────────────────────────────────────┤ │ Terraform │ Ansible │ Docker │ │ ├─ Infrastructure │ ├─ Configuration │ ├─ Services │ │ ├─ State Mgmt │ ├─ Monitoring │ ├─ Networks │ │ └─ Multi-Env │ └─ Automation │ └─ Volumes │ └─────────────────────────────────────────────────────────────┘

📁 Directory Structure

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

🚀 Quick Start

Prerequisites

  • Ubuntu 24.04 LTS
  • Docker & Docker Compose
  • Terraform v1.9.4+
  • Ansible v2.16+

Installation & Deployment

  1. 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

About

Enterprise-grade Infrastructure as Code automation using Terraform and Ansible for multi-cloud deployments, CI/CD pipelines, and security hardening. Reduces manual infrastructure setup by 70% and ensures compliance with automated security scanning.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors