A forward-looking foundation for teams building Software Defined Infrastructure with a monorepo, GitLab CI, and Ansible.
This template provides a practical operating model for building, validating, and deploying from a single source of truth.
- One repository for application delivery and infrastructure automation.
- Atomic pull requests across app + infra + CI changes.
- Clear ownership and simpler review workflows.
- Reproducible onboarding with one consistent project structure.
- Infrastructure behavior lives in versioned code.
- Changes are peer-reviewed, auditable, and reversible.
- Desired state is explicit and continuously enforceable.
- Environments can be promoted through repeatable pipelines.
- GitLab CI orchestrates workflow, approvals, and environment promotion.
- Child pipelines keep delivery domains modular and scalable.
- Ansible handles host-side state changes with clear playbook contracts.
- Shared templates standardize deploy safety checks across services.
/.gitlab-ci.yml: root dispatcher pipeline./ci/components/: child pipeline templates for application and infrastructure paths./ci/templates/: reusable deployment and notification templates./infra/ansible/: baseline inventory, lint config, and starter playbooks./docs/runbooks/: operational runbooks for guarded production delivery.
- Add service code under
apps/. - Tailor
ci/components/application-template.ymlfor your build and packaging flow. - Configure CI variables (
DEPLOY_SSH_KEY,TARGET_PREPARE,TARGET_PRODUCTION). - Update
infra/ansible/inventories/production/hosts.ymlfor your hosts. - Replace starter playbooks in
infra/ansible/playbooks/with your deployment automation. - Enable protected production environments and manual approvals.
APP: force dispatch target (application-template,infra-template,all)ENABLE_DEPLOY: whentrue, enables non-manual prepare deploysDEPLOY_SSH_KEY: private key used by deploy templatesTARGET_PREPARE: optional preview target overrideTARGET_PRODUCTION: optional production target overrideMATTERMOST_WEBHOOK_URL: optional CI notification webhook
- Phase 1: Validate inventories and playbooks (
infra-template). - Phase 2: Deploy one service to preview.
- Phase 3: Add protected manual production promotion.
- Phase 4: Scale to multi-service SDI delivery.
MIT License. See LICENSE.