mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented a new docker compose structure which seperates between docker compose files and environment variable file to protect credentials better. Also did recatoring. Changes not fully tested
This commit is contained in:
@@ -6,6 +6,16 @@
|
||||
- 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.directories.instance}}docker-compose.yml
|
||||
- name: "create {{docker_compose.files.docker_compose}}"
|
||||
template:
|
||||
src: "docker-compose.yml.j2"
|
||||
dest: "{{docker_compose.files.docker_compose}}"
|
||||
notify: docker compose project setup
|
||||
|
||||
- name: "create {{docker_compose.files.env}}"
|
||||
template:
|
||||
src: "env.j2"
|
||||
dest: "{{docker_compose.files.env}}"
|
||||
mode: '770'
|
||||
force: yes
|
||||
notify: docker compose project setup
|
||||
|
@@ -6,28 +6,8 @@ services:
|
||||
|
||||
web:
|
||||
image: "gitlab/gitlab-ee:{{applications.gitlab.version}}"
|
||||
restart: {{docker_restart_policy}}
|
||||
hostname: '{{domain}}'
|
||||
environment:
|
||||
GITLAB_OMNIBUS_CONFIG: |
|
||||
external_url 'https://{{domain}}'
|
||||
postgresql['enable'] = false
|
||||
gitlab_rails['gitlab_shell_ssh_port'] = {{ports.public.ssh_ports[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'
|
||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||
ports:
|
||||
- "127.0.0.1:{{http_port}}:80"
|
||||
- "{{ports.public.ssh_ports[application_id]}}:22"
|
||||
|
22
roles/docker-gitlab/templates/env.j2
Normal file
22
roles/docker-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_ports[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') }}"
|
Reference in New Issue
Block a user