The Professional DevOps Stack is a complete, production-ready infrastructure automation platform that deploys a modern DevOps environment with enterprise-grade security. Built with Infrastructure as Code principles, it provides everything needed for software development teams to collaborate, build, and deploy applications securely.
- π One-Command Deployment - Deploy entire DevOps infrastructure with a single command
- π Security-First Design - Enterprise security with encrypted secrets, firewall, and intrusion prevention
- β‘ Production Ready - Optimized for performance with resource limits and monitoring
- π Domain Management - Automatic SSL certificates and subdomain routing
- π Complete Observability - Logging, monitoring, and service health checks
- π§ Developer Friendly - Easy configuration, clear documentation, and extensible design
graph TB
subgraph "Internet"
USER[π€ Users]
DNS[π DNS Provider]
end
subgraph "Security Layer"
UFW[π‘οΈ UFW Firewall<br/>Ports: 22, 80, 443]
F2B[π« Fail2ban<br/>Intrusion Prevention]
end
subgraph "Reverse Proxy Layer"
TRAEFIK[π Traefik v3.4<br/>Reverse Proxy<br/>SSL Termination]
LE[π Let's Encrypt<br/>SSL Certificates]
end
subgraph "Application Layer"
subgraph "CI/CD Services"
JENKINS[β‘ Jenkins LTS<br/>CI/CD Platform<br/>Port: 8080]
DOCKER[π³ Docker Engine<br/>Container Runtime]
end
subgraph "Communication Services"
MATTERMOST[π¬ Mattermost<br/>Team Chat<br/>Port: 8065]
POSTGRES[ποΈ PostgreSQL 17<br/>Database]
end
end
subgraph "Storage Layer"
VOLUMES[πΎ Docker Volumes<br/>Persistent Data]
CONFIG[π Configuration Files<br/>/opt/project-name/]
end
subgraph "Automation Layer"
ANSIBLE[π€ Ansible<br/>Infrastructure as Code]
VAULT[π Ansible Vault<br/>Encrypted Secrets]
end
%% User Flow
USER --> DNS
DNS --> UFW
UFW --> F2B
F2B --> TRAEFIK
%% SSL Certificate Flow
TRAEFIK <--> LE
%% Service Routing
TRAEFIK --> JENKINS
TRAEFIK --> MATTERMOST
%% Data Flow
JENKINS --> DOCKER
MATTERMOST --> POSTGRES
%% Storage
JENKINS --> VOLUMES
MATTERMOST --> VOLUMES
POSTGRES --> VOLUMES
%% Configuration
ANSIBLE --> CONFIG
VAULT --> ANSIBLE
%% Styling
classDef security fill:#ff6b6b,stroke:#d63447,stroke-width:2px,color:#fff
classDef proxy fill:#4ecdc4,stroke:#45b7aa,stroke-width:2px,color:#fff
classDef app fill:#45b7d1,stroke:#2196F3,stroke-width:2px,color:#fff
classDef data fill:#96ceb4,stroke:#81c784,stroke-width:2px,color:#fff
classDef automation fill:#ffeaa7,stroke:#fdcb6e,stroke-width:2px,color:#333
class UFW,F2B security
class TRAEFIK,LE proxy
class JENKINS,MATTERMOST,DOCKER,POSTGRES app
class VOLUMES,CONFIG data
class ANSIBLE,VAULT automation
| Component | Technology | Purpose | Access URL |
|---|---|---|---|
| π Reverse Proxy | Traefik v3.4 | SSL termination, routing, load balancing | https://traefik.yourdomain.com |
| β‘ CI/CD Platform | Jenkins LTS | Continuous integration & deployment | https://cicd.yourdomain.com |
| π¬ Team Communication | Mattermost Team Edition | Team collaboration & notifications | https://chat.yourdomain.com |
| ποΈ Database | PostgreSQL 17 | Data persistence for Mattermost | Internal only |
| π³ Container Runtime | Docker Engine + Compose | Application containerization | Internal only |
| π‘οΈ Security | UFW + Fail2ban | Network security & intrusion prevention | System level |
| Requirement | Version | Notes |
|---|---|---|
| Server | Ubuntu 20.04+ | 6GB RAM, 50GB storage, root access |
| Domain | Valid domain | DNS management access required |
| Control Machine | Ansible 2.9+ | Python 3.8+, SSH key access |
# Clone the repository
git clone <your-repo-url>
cd devops-stack
# Install Ansible collections
make install
# Create configuration files from templates
cp inventory/hosts.yml.example inventory/hosts.yml
cp group_vars/vault.yml.example group_vars/vault.ymlEdit your server details in inventory/hosts.yml:
devops_servers:
hosts:
your-server:
ansible_host: 192.168.1.100 # Your server IP
ansible_user: admin # Your SSH username
ansible_ssh_private_key_file: ~/.ssh/id_rsa # Your SSH keyEdit group_vars/vault.yml with your settings:
# Project details
vault_project_name: "acme-devops"
vault_organization: "ACME Corporation"
vault_domain: "acme.com"
vault_ssl_email: "[email protected]"
# Generate secure passwords (use: openssl rand -base64 32 | tr -d "=+/" | cut -c1-25)
vault_traefik_admin_password: "your-secure-password"
vault_jenkins_admin_password: "your-secure-password"
vault_db_password: "your-secure-db-password"# Encrypt sensitive configuration
ansible-vault encrypt group_vars/vault.yml
# Test connectivity
make ping
# Deploy the complete stack
make deployPoint these subdomains to your server IP:
traefik.yourdomain.comβ Server IPcicd.yourdomain.comβ Server IPchat.yourdomain.comβ Server IP
Purpose: Central entry point for all services with automatic SSL certificates
Features:
- Automatic Let's Encrypt SSL certificates
- HTTP to HTTPS redirection
- Service discovery via Docker labels
- Security headers and protection
- Web dashboard for monitoring
Configuration:
- Static config:
/opt/project-name/config/traefik/traefik.yml - Dynamic config:
/opt/project-name/config/traefik/dynamic/ - SSL certificates:
/opt/project-name/config/traefik/acme.json
Purpose: Continuous integration and deployment platform
Features:
- Jenkins LTS with Docker support
- Pipeline as Code capabilities
- Plugin ecosystem
- Secure credential management
- Integration with version control
Initial Setup:
- Navigate to
https://cicd.yourdomain.com - Use initial admin password from deployment output
- Install suggested plugins
- Create admin user
- Configure your first pipeline
Docker Integration:
- Docker socket mounted for container builds
- Docker CLI available inside Jenkins
- Support for Docker Compose deployments
Purpose: Team collaboration and DevOps notifications
Features:
- Team messaging and file sharing
- Bot integrations and webhooks
- Jenkins build notifications
- Mobile and desktop apps
- PostgreSQL backend for reliability
Setup Process:
- Navigate to
https://chat.yourdomain.com - Create system admin account
- Set up teams and channels
- Configure Jenkins webhook integration
- Set up notification preferences
Purpose: Reliable data storage for Mattermost
Features:
- PostgreSQL 17 Alpine (lightweight)
- Persistent data volumes
- Automated backups (optional)
- Performance optimized settings
Management:
- Access via Mattermost application
- Database dumps via Docker exec
- Monitoring via application logs
graph TB
subgraph "Security Layers"
L1[π DNS & Domain Validation]
L2[π‘οΈ UFW Firewall<br/>Port Filtering]
L3[π« Fail2ban<br/>Intrusion Prevention]
L4[π SSL/TLS Encryption<br/>Let's Encrypt]
L5[π Application Security<br/>Authentication & Authorization]
L6[ποΈ Data Security<br/>Encrypted Storage]
end
L1 --> L2
L2 --> L3
L3 --> L4
L4 --> L5
L5 --> L6
classDef security fill:#ff6b6b,stroke:#d63447,stroke-width:2px,color:#fff
class L1,L2,L3,L4,L5,L6 security
| Security Layer | Technology | Configuration |
|---|---|---|
| Secrets Management | Ansible Vault | AES256 encryption for all sensitive data |
| Network Security | UFW Firewall | Only ports 22, 80, 443 open |
| Intrusion Prevention | Fail2ban | SSH brute force protection |
| Transport Security | Let's Encrypt | Automatic SSL certificate management |
| Application Security | Basic Auth | Protected dashboards and admin interfaces |
| Container Security | Non-root containers | Resource limits and security contexts |
β Template-based Configuration - No hardcoded secrets in code β Encrypted Storage - All passwords encrypted with Ansible Vault β Minimal Attack Surface - Only necessary ports exposed β Automatic Updates - Security patches applied automatically β Strong Authentication - Complex passwords and secure defaults β Container Isolation - Services run in isolated containers
# Check service status
make status
# View service logs
make logs-jenkins
make logs-mattermost
make logs-traefik
# Restart services
make restart-services
# Update system packages
make update-system
# Security audit
make security-audit-
Create Jenkins Pipeline:
pipeline { agent any stages { stage('Build') { steps { sh 'docker build -t myapp .' } } stage('Test') { steps { sh 'docker run --rm myapp npm test' } } stage('Deploy') { steps { sh 'docker-compose up -d' } } } post { always { // Send notification to Mattermost mattermostSend color: 'good', message: "Build ${currentBuild.displayName} completed", endpoint: 'https://chat.yourdomain.com/hooks/...' } } } -
Configure Mattermost Webhook:
- Go to Mattermost β Integrations β Incoming Webhooks
- Create webhook for your channel
- Add webhook URL to Jenkins pipeline
To add a new service to the stack:
- Update Docker Compose template (
roles/*/templates/*.yml.j2) - Add Traefik labels for routing
- Configure firewall rules if needed
- Deploy changes:
make deploy
# Manual backup
docker exec postgres pg_dump -U admin mattermost > backup.sql
docker exec jenkins tar -czf - /var/jenkins_home > jenkins-backup.tar.gz
# Restore from backup
docker exec -i postgres psql -U admin mattermost < backup.sql
docker exec -i jenkins tar -xzf - -C /var/jenkins_home < jenkins-backup.tar.gz| Variable | Purpose | Example |
|---|---|---|
vault_project_name |
Project identifier | "acme-devops" |
vault_organization |
Company name | "ACME Corp" |
vault_domain |
Base domain | "acme.com" |
vault_environment |
Deployment stage | "production" |
Default resource limits (configurable in vault):
# CPU and Memory limits
vault_traefik_cpu_limit: "0.5" # 50% of 1 CPU core
vault_traefik_memory_limit: "512m" # 512MB RAM
vault_jenkins_cpu_limit: "2.0" # 2 CPU cores
vault_jenkins_memory_limit: "2g" # 2GB RAM
vault_mattermost_cpu_limit: "1.0" # 1 CPU core
vault_mattermost_memory_limit: "2g" # 2GB RAM| Service | Internal Port | External Access |
|---|---|---|
| Traefik Dashboard | 8080 | https://traefik.domain.com |
| Jenkins | 8080 | https://cicd.domain.com |
| Mattermost | 8065 | https://chat.domain.com |
| PostgreSQL | 5432 | Internal only |
Problem: Cannot connect to services Solutions:
# Check DNS resolution
nslookup cicd.yourdomain.com
# Verify SSL certificates
curl -I https://cicd.yourdomain.com
# Check Traefik routing
make logs-traefikProblem: SSL certificate not generated Solutions:
# Check Let's Encrypt rate limits
# Verify domain DNS points to server
# Check Traefik logs for ACME errors
docker logs traefik | grep -i acmeProblem: Jenkins initial password not found Solutions:
# Get initial password manually
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
# Reset Jenkins if needed
docker exec jenkins rm /var/jenkins_home/config.xml
docker restart jenkinsProblem: Mattermost cannot connect to PostgreSQL Solutions:
# Check PostgreSQL status
docker logs postgres
# Verify network connectivity
docker exec mattermost ping postgres
# Check database credentials in logs
docker logs mattermost | grep -i database# Full deployment with verbose output
make debug-full
# Check service health
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
# Network inspection
docker network inspect devops-stack_network
# Volume inspection
docker volume ls
docker volume inspect devops-stack_jenkins_dataIf services fail to start:
# Stop all services
cd /opt/your-project-name
docker compose -f traefik-compose.yml down
docker compose -f cicd-compose.yml down
# Clean up and restart
docker system prune -f
make deployThe system includes built-in health monitoring:
# Service status overview
make status
# Individual service logs
docker logs traefik --tail 50
docker logs jenkins --tail 50
docker logs mattermost --tail 50
docker logs postgres --tail 50
# System resource usage
docker statsMonitor key metrics:
- CPU Usage: Should be below 80% under normal load
- Memory Usage: Services should stay within configured limits
- Disk Usage: Monitor
/opt/project-nameand Docker volumes - Network: Monitor SSL certificate expiry and connectivity
- Check service logs for errors
- Monitor resource usage
- Verify backup processes
- Review security logs
- Update system packages:
make update-system - Clean up Docker resources:
docker system prune
- Review and rotate passwords
- Update service configurations
- Plan capacity upgrades if needed
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Test your changes with a development environment
- Follow security guidelines (no hardcoded secrets)
- Submit a pull request with detailed description
π¨ Critical: Never commit real credentials or configurations
- Always use template files with placeholders
- Test with dummy data only
- Use Ansible Vault for any secrets
- Document security implications of changes
- Use descriptive variable names
- Comment complex configurations
- Follow Ansible best practices
- Include error handling
This project is licensed under the MIT License - see the LICENSE file for details.
- Security Focus: Built with security-first principles
- Community: Thanks to the open-source community for the underlying technologies
- Best Practices: Follows infrastructure as code and DevOps best practices
- Issues: Report bugs and request features via GitHub Issues
- Documentation: Check the
/docsdirectory for detailed guides - Community: Join our discussions for help and sharing
Built with β€οΈ for Professional Software Development Teams