- Terraform: Used for provisioning and managing the infrastructure.
- Ansible: Used for configuration management and application deployment.
- Docker Swarm: Used for container orchestration.
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Set up environment variables:
- Create a
.env
file in the root directory and add the necessary environment variables.
- Create a
-
Set up Swarm/static_ip.ini ips:
- Add the static IP addresses and SSH locations details for the VMs in the
Swarm/static_ip.ini
file.
- Add the static IP addresses and SSH locations details for the VMs in the
-
Set up SSH keys:
- Add the private keys for SSH access to the VMs in the
ssh_keys/
directory.
- Add the private keys for SSH access to the VMs in the
-
Run the deployment script:
Set up permissions to the script:
chmod +x deploy.sh
./deploy.sh
This script will:
- Initialize and apply the Terraform configuration to provision the infrastructure.
- Deploy the Docker Swarm stack using Ansible.
- Run additional Ansible playbooks to configure the VMs.
-
Run the destroy script:
./destroy.sh
This script will:
- Destroy the infrastructure provisioned by Terraform.
- Configuration/runners.yml: Contains tasks to set up GitLab Runners.
- Swarm/swarm_setup.yml: Contains tasks to configure the Docker Swarm cluster.
- Swarm/static_ip.ini: Contains the static IP addresses and SSH details for the VMs.
- ssh_keys/: Contains the private keys for SSH access to the VMs.
Use the built-in continuous integration in GitLab.
This project is licensed under the MIT License - see the LICENSE file for details.