Implemented helper role docker-central-database and refactored code

This commit is contained in:
2025-02-04 18:14:37 +01:00
parent cb6a42e97d
commit 5503326ea6
91 changed files with 358 additions and 237 deletions

View File

@@ -15,7 +15,7 @@ This Ansible role is designed for setting up and managing a GitLab server runnin
## Role Variables
Variables are defined in `vars/main.yml`. Key variables include:
- `docker_compose_instance_directory`: Directory for Docker Compose instances.
- `docker_compose.directories.instance`: Directory for Docker Compose instances.
- `application_id`, `database_host`, `database_name`, `database_username`, `database_password`: Database configuration variables.
## Handlers

View File

@@ -1,10 +1,11 @@
---
- name: "include docker/compose/database.yml"
include_tasks: docker/compose/database.yml
- name: "include docker-central-database"
include_role:
name: docker-central-database
- name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml
- name: add docker-compose.yml
template: src=docker-compose.yml.j2 dest={{docker_compose_instance_directory}}docker-compose.yml
template: src=docker-compose.yml.j2 dest={{docker_compose.directories.instance}}docker-compose.yml
notify: docker compose project setup

View File

@@ -2,7 +2,7 @@ services:
{% include 'templates/docker/services/redis.yml.j2' %}
{% include 'templates/docker/services/' + database_type + '.yml.j2' %}
{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}
web:
image: "gitlab/gitlab-ee:{{applications.gitlab.version}}"