The purpose of this repository is to host the end of degree project in Computer Engineering from the Higher School of Informatics and Telecommunications of Granada.
The main objective of this work can be divided into different parts.
Automate everything related to infrastructure of a company using Ansible playbooks.
Implement CI/CD for a company that develops Django projects.
Anyway, to make this repository more readable, it will be divided into three blocks that are explained below.
Summarizing this part, configure a Hetzner server from scratch, installing and configuring the virtualization service proxmox. For more detail follow the links below.
hosts.yml
file. As an example if you want to execute first part of the project a hosts.yml
file should look like:---
all:
hosts:
children:
proxmox_master:
hosts:
node1.yourdomain.com:
ansible_host: node1.yourdomain.com
ansible_user: root
node: node1
proxmox_slave:
hosts:
node2.yourdomain.com:
ansible_host: node2.yourdomain.com
ansible_user: root
node: node2
proxmox_nodes:
hosts:
node3.yourdomain.com:
ansible_host: node3.yourdomain.com
ansible_user: root
node: node3
proxmox:
hosts:
node1.yourdomain.com:
node2.yourdomain.com:
node3.yourdomain.com:
Make sure that Makefile
is pointing to correct hosts.yml file.
Configure playbook vars. At the beggining of the playbook there are a few vars you must fill.
Execute playbook. With TAGS var you can choose wich parts of the playbook execute, in case you don't want to execute everything.
make PLAYBOOK=configure_proxmox_nodes TAGS=all playbook
If Part 1 is completed, we should have:
This second part includes:
Ideally the infrastructure should look like:
Includes:
This part includes the deployment of many services on the Proxmox cluster. You may want to deploy all of some of them. Each service is managed by an Ansible playbook and has a role associated. Check each playbook doc to learn how to deploy each service.
hosts.yml
file. You must add one entry per each service you want to deploy. For example, if we want to deploy all services our hosts file should look like hosts file.This project is for Django + Angular application. Check dockerize app to learn how to dockerize a Django + Angular app.
Thanks to the deployment of servies of part 2, we have GitLab on our cluster and we are going to configure it in order to create CI/CD pipelines. Check gitlab ci to learn how to create CI/CD pipelines for a containerized app.