Add gitlab

This commit is contained in:
Jake Howard 2020-08-29 23:56:14 +01:00
parent da90b12643
commit 0ce15cb4d8
Signed by: jake
GPG key ID: 57AFB45680EDD477
5 changed files with 92 additions and 0 deletions

View file

@ -43,6 +43,7 @@
- plausible
- duplicati
- grafana
- gitlab
- hosts: walker
roles:

View file

@ -0,0 +1,45 @@
version: "2.3"
services:
gitlab:
image: gitlab/gitlab-ce:latest
hostname: gitlab.theorangeone.net
environment:
TZ: Europe/London
GITLAB_OMNIBUS_CONFIG: |
{% filter indent(width=8) %}
{%- include "gitlab.rb" %}
{% endfilter %}
volumes:
- ./config:/etc/gitlab
- ./data:/var/opt/gitlab
tmpfs:
- /var/log/gitlab
restart: unless-stopped
depends_on:
- db
- redis
labels:
- traefik.enable=true
- traefik.http.routers.gitlab.rule=Host(`gitlab.theorangeone.net`)
- traefik.http.routers.gitlab.tls.certresolver=le
- traefik.http.services.gitlab-gitlab.loadbalancer.server.port=80
- traefik.http.services.gitlab-gitlab.loadbalancer.server.scheme=http
- traefik.http.routers.gitlab.middlewares=compress@file
db:
image: postgres:12-alpine
restart: unless-stopped
volumes:
- ./postgres:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=gitlab
- POSTGRES_USER=gitlab
- POSTGRES_DB=gitlabhq_production
redis:
image: redis:6-alpine
restart: unless-stopped
volumes:
- ./redis:/data

View file

@ -0,0 +1,25 @@
external_url 'https://gitlab.theorangeone.net'
nginx['redirect_http_to_https'] = false
nginx['listen_https'] = false
nginx['listen_port'] = 80
grafana['enable'] = false
nginx['status'] = {
'enable' => false
}
letsencrypt['enable'] = false
puma['worker_processes'] = 2
puma['max_threads'] = 6
gitlab_rails['time_zone'] = 'Europe/London'
alertmanager['enable'] = false
prometheus_monitoring['enable'] = false
postgresql['enable'] = false
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'unicode'
gitlab_rails['db_host'] = 'db'
gitlab_rails['db_password'] = 'gitlab'
redis['enable'] = false
gitlab_rails['redis_host'] = 'redis'
gitlab_rails['redis_port'] = 6379

View file

@ -0,0 +1,4 @@
- name: restart gitlab
shell:
chdir: /opt/gitlab
cmd: "{{ docker_update_command }}"

View file

@ -0,0 +1,17 @@
- name: Create install directory
file:
path: /opt/gitlab
state: directory
owner: "{{ docker_user.name }}"
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install compose file
template:
src: files/docker-compose.yml
dest: /opt/gitlab/docker-compose.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
validate: /usr/bin/docker-compose -f %s config
notify: restart gitlab
become: true