mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Huge role refactoring/cleanup. Other commits will propably follow. Because some bugs will exist. Still important for longrun and also for auto docs/help/slideshow generation
This commit is contained in:
32
roles/web-app-gitlab/README.md
Normal file
32
roles/web-app-gitlab/README.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# GitLab
|
||||
|
||||
## Description
|
||||
|
||||
Accelerate your development with GitLab, an all-in-one platform for source code management, CI/CD, and more. Experience a robust and collaborative environment that empowers your development process.
|
||||
|
||||
## Overview
|
||||
|
||||
This role deploys GitLab using Docker, automating the installation, configuration, and management of your GitLab server. It integrates with an external PostgreSQL database and sets up an Nginx reverse proxy, streamlining your GitLab deployment through efficient container orchestration and customizable Ansible variables.
|
||||
|
||||
For a detailed walkthrough of this role, please refer to the [ChatGPT Session Transcript](https://chat.openai.com/share/1b0147bf-d4de-4790-b8ed-c332aa4e3ce3).
|
||||
|
||||
## Features
|
||||
|
||||
- **GitLab Installation:** Automatically deploys GitLab within a Docker container.
|
||||
- **External PostgreSQL Database:** Configures GitLab to connect to an external PostgreSQL database.
|
||||
- **Nginx Reverse Proxy Integration:** Simplifies secure access with an Nginx reverse proxy.
|
||||
- **Customizable Configuration:** Easily tailor deployment settings using Ansible variables and templates.
|
||||
|
||||
## Further Resources
|
||||
|
||||
- [GitLab Official Website](https://about.gitlab.com/)
|
||||
- [Running GitLab on Docker](https://ralph.blog.imixs.com/2019/06/09/running-gitlab-on-docker/)
|
||||
- [Reducing GitLab Memory Consumption](https://techoverflow.net/2020/04/18/how-i-reduced-gitlab-memory-consumption-in-my-web-app-based-setup/)
|
||||
|
||||
## Credits
|
||||
|
||||
Developed and maintained by **Kevin Veen-Birkenbach**.
|
||||
Learn more at [veen.world](https://www.veen.world).
|
||||
|
||||
Part of the [CyMaIS Project](https://github.com/kevinveenbirkenbach/cymais)
|
||||
Licensed under [CyMaIS NonCommercial License (CNCL)](https://s.veen.world/cncl).
|
26
roles/web-app-gitlab/meta/main.yml
Normal file
26
roles/web-app-gitlab/meta/main.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: "Kevin Veen-Birkenbach"
|
||||
description: "Accelerate your development with GitLab, an all-in-one platform for source code management, CI/CD, and more. Experience a robust and collaborative environment that empowers your development process."
|
||||
license: "CyMaIS NonCommercial License (CNCL)"
|
||||
license_url: "https://s.veen.world/cncl"
|
||||
company: |
|
||||
Kevin Veen-Birkenbach
|
||||
Consulting & Coaching Solutions
|
||||
https://www.veen.world
|
||||
galaxy_tags:
|
||||
- gitlab
|
||||
- docker
|
||||
- ci/cd
|
||||
- self-hosted
|
||||
- version control
|
||||
repository: https://s.veen.world/cymais
|
||||
issue_tracker_url: https://s.veen.world/cymaisissues
|
||||
documentation: https://s.veen.world/cymais
|
||||
logo:
|
||||
class: "fa-solid fa-code-branch"
|
||||
run_after:
|
||||
- web-app-matomo
|
||||
- web-app-keycloak
|
||||
- web-app-mailu
|
||||
dependencies: []
|
5
roles/web-app-gitlab/meta/schema.yml
Normal file
5
roles/web-app-gitlab/meta/schema.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
credentials:
|
||||
initial_root_password:
|
||||
description: "Initial password for the GitLab root user"
|
||||
algorithm: "sha256"
|
||||
validation: "^[a-f0-9]{64}$"
|
11
roles/web-app-gitlab/tasks/main.yml
Normal file
11
roles/web-app-gitlab/tasks/main.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: "include service-rdbms-central"
|
||||
include_role:
|
||||
name: service-rdbms-central
|
||||
|
||||
- name: "include role webserver-proxy-domain for {{application_id}}"
|
||||
include_role:
|
||||
name: webserver-proxy-domain
|
||||
vars:
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
24
roles/web-app-gitlab/templates/docker-compose.yml.j2
Normal file
24
roles/web-app-gitlab/templates/docker-compose.yml.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
{% include 'roles/docker-compose/templates/base.yml.j2' %}
|
||||
|
||||
web:
|
||||
image: "{{ applications[application_id].images.gitlab }}"
|
||||
hostname: '{{domains | get_domain(application_id)}}'
|
||||
{% include 'roles/docker-container/templates/base.yml.j2' %}
|
||||
ports:
|
||||
- "127.0.0.1:{{ports.localhost.http[application_id]}}:80"
|
||||
- "{{ports.public.ssh[application_id]}}:22"
|
||||
volumes:
|
||||
- 'config:/etc/gitlab'
|
||||
- 'logs:/var/log/gitlab'
|
||||
- 'data:/var/opt/gitlab'
|
||||
shm_size: '256m'
|
||||
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
|
||||
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
||||
|
||||
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
|
||||
redis:
|
||||
config:
|
||||
logs:
|
||||
data:
|
||||
|
||||
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
|
22
roles/web-app-gitlab/templates/env.j2
Normal file
22
roles/web-app-gitlab/templates/env.j2
Normal file
@@ -0,0 +1,22 @@
|
||||
{# env.j2 #}
|
||||
{% set config_lines = [
|
||||
"external_url 'https://{{ domain }}'",
|
||||
"postgresql['enable']=false",
|
||||
"gitlab_rails['gitlab_shell_ssh_port']={{ ports.public.ssh[application_id] }}",
|
||||
"gitlab_rails['db_adapter']='postgresql'",
|
||||
"gitlab_rails['db_encoding']='utf8'",
|
||||
"gitlab_rails['db_host']='{{ database_host }}'",
|
||||
"gitlab_rails['db_port']='{{ database_port }}'",
|
||||
"gitlab_rails['db_username']='{{ database_username }}'",
|
||||
"gitlab_rails['db_password']='{{ database_password }}'",
|
||||
"gitlab_rails['db_database']=\"{{ database_name }}\"",
|
||||
"nginx['listen_port']=80",
|
||||
"nginx['listen_https']=false",
|
||||
"",
|
||||
"gitlab_rails['initial_root_password']=\"{{ gitlab_initial_root_password }}\"",
|
||||
"",
|
||||
"redis['enable']=false",
|
||||
"gitlab_rails['redis_host']='redis'",
|
||||
"gitlab_rails['redis_port']='6379'"
|
||||
] %}
|
||||
GITLAB_OMNIBUS_CONFIG="{{ config_lines | join('\\n') }}"
|
13
roles/web-app-gitlab/vars/configuration.yml
Normal file
13
roles/web-app-gitlab/vars/configuration.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
images:
|
||||
gitlab: "gitlab/gitlab-ee:latest"
|
||||
features:
|
||||
matomo: true
|
||||
css: true
|
||||
portfolio_iframe: true
|
||||
central_database: true
|
||||
docker:
|
||||
services:
|
||||
redis:
|
||||
enabled: true
|
||||
database:
|
||||
enabled: true
|
2
roles/web-app-gitlab/vars/main.yml
Normal file
2
roles/web-app-gitlab/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
application_id: "gitlab"
|
||||
database_type: "postgres"
|
Reference in New Issue
Block a user