This repository contains infrastructure as code. The goal of this repo is setup and manage configuration of SaaS applications (Sentry, GitLab, New Relic, Mailgun, Grafana) and raw infrastructure (OVH, KVM/libvirt, AWS).
The structure of this repository is split in three main directories - intrastructure, servers and workstation.
The directory infrastructure
contains terraform files for:
- setup project and alerts in Senty
- assign gitlab-runners to projects in GitLab
- manage projects in GitLab
- manage deployment keys in GitLab
- setup virtual machines
- manage DNS zone in OVH and Cloudflare
- manage alerts in New Relic
- manage resources in AWS (S3, budget, IAM)
- manage email accounts in Mailgun
- manage dashboards in Grafana
- manage repositories in Docker Hub
- manage Auth0
- manage repositories in GitHub
The directory servers
contains ansible playbook, which configure virtual machines.
The vm-gitlab playbook install and configure gitlab-runner, which can be used in lieu of GitLab's shared runners.
The vm-k8s playbook setup one-node Kubernetes cluster.
Ansible playbooks in workstation directory are used to setup and maintain configuration of workstations.
- vagrant up
- vagrant ssh tumbleweed
- git clone https://github.com/morawskim/provision-dev-servers.git
- ssh-keyscan leap.local >> ~/.ssh/known_hosts
- cd ~/provision-dev-servers/server
- make deploy-nuc-vagrant
- cd ~/provision-dev-servers/infrastructure/kvm/vagrant/
- make setup
- terraform init
- make vagrant-apply
Now you can connect to vm. Open a new terminal go to dir to which you cloned this repository and type make vagrant-ssh-jump VM=<vm-name>
to connect to virtual machine.
At the moment only k8s and gitlab are allowed as vm-name
.
Also you might need to wait few seconds to connect to vm (vm machine need be booted).