Compare commits
11 Commits
7cb068b886
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 499daebb0c | |||
| d6d816665c | |||
| e2d802b963 | |||
| 6389205bed | |||
| 5ae277dd3f | |||
| 062c0b9c6c | |||
| 428cda4bf8 | |||
| 6f5b0fb21d | |||
| db3760cb35 | |||
| 2927b066a5 | |||
| 10ac673a16 |
2
gitlab/README.md
Normal file → Executable file
2
gitlab/README.md
Normal file → Executable file
@@ -1,4 +1,4 @@
|
|||||||
Ausslesen des root passworts im Container
|
Auslesen des root passworts im Container
|
||||||
|
|
||||||
docker exec -ti gitlab-ce grep 'Password:' /etc/gitlab/initial_root_password
|
docker exec -ti gitlab-ce grep 'Password:' /etc/gitlab/initial_root_password
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
- name: "Install gitlab in Docker"
|
- name: "Install gitlab in Docker"
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
become: false
|
become: false
|
||||||
hosts: ubuntu
|
hosts: localhost
|
||||||
#connection: local
|
connection: local
|
||||||
# vars:
|
vars:
|
||||||
# ansible_user: jonnybravo
|
ansible_user: jonnybravo
|
||||||
roles:
|
roles:
|
||||||
- prereq_gitlab
|
- prereq_gitlab
|
||||||
- docker_gitlab
|
- docker_gitlab
|
||||||
|
|||||||
10
gitlab/group_vars/all/main.yml
Normal file → Executable file
10
gitlab/group_vars/all/main.yml
Normal file → Executable file
@@ -1,6 +1,8 @@
|
|||||||
|
gitlab_folder: ".gitlab2"
|
||||||
gitlab_dir:
|
gitlab_dir:
|
||||||
- "/home/{{ansible_user}}/.gitlab"
|
- "/home/{{ansible_user}}/{{gitlab_folder}}"
|
||||||
- "/home/{{ansible_user}}/.gitlab/config"
|
- "/home/{{ansible_user}}/{{gitlab_folder}}/config"
|
||||||
- "/home/{{ansible_user}}/.gitlab/log"
|
- "/home/{{ansible_user}}/{{gitlab_folder}}/log"
|
||||||
- "/home/{{ansible_user}}/.gitlab/data"
|
- "/home/{{ansible_user}}/{{gitlab_folder}}/data"
|
||||||
|
- "/home/{{ansible_user}}/{{gitlab_folder}}/config/ssl"
|
||||||
|
|
||||||
|
|||||||
0
gitlab/inv/devel/hosts
Normal file → Executable file
0
gitlab/inv/devel/hosts
Normal file → Executable file
Binary file not shown.
35
gitlab/roles/docker_gitlab/tasks/main.yml
Normal file → Executable file
35
gitlab/roles/docker_gitlab/tasks/main.yml
Normal file → Executable file
@@ -1,11 +1,44 @@
|
|||||||
---
|
---
|
||||||
|
- name:
|
||||||
|
shell: "hostnamectl hostname"
|
||||||
|
register: var_gitlab_hostname
|
||||||
|
|
||||||
|
- name: Set fact for gitlab_hostname
|
||||||
|
set_fact:
|
||||||
|
gitlab_hostname: "{{ var_gitlab_hostname.stdout }}"
|
||||||
|
|
||||||
- name: Template Docker compose
|
- name: Template Docker compose
|
||||||
template:
|
template:
|
||||||
src: docker-compose.yml.j2
|
src: docker-compose.yml.j2
|
||||||
dest: "{{gitlab_dir[0]}}/docker-compose.yml"
|
dest: "{{gitlab_dir[0]}}/docker-compose.yml"
|
||||||
owner: "{{ansible_user}}"
|
owner: "{{ansible_user}}"
|
||||||
group: "{{ansible_user}}"
|
group: "{{ansible_user}}"
|
||||||
mode: 0777
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Generate an OpenSSL private key with the default values (4096 bits, RSA)
|
||||||
|
openssl_privatekey:
|
||||||
|
path: "{{gitlab_dir[4]}}/gitlab.key"
|
||||||
|
size: 4096
|
||||||
|
|
||||||
|
- name: Generate an OpenSSL Certificate Signing Request
|
||||||
|
openssl_csr:
|
||||||
|
path: "{{gitlab_dir[4]}}/gitlab.csr"
|
||||||
|
privatekey_path: "{{gitlab_dir[4]}}/gitlab.key"
|
||||||
|
#common_name: "{{ansible_hostname}"
|
||||||
|
common_name: "man-dan-03"
|
||||||
|
subject_alt_name: "{{ item.value | map('regex_replace', '^', 'DNS:') | list }}"
|
||||||
|
with_dict:
|
||||||
|
dns_server:
|
||||||
|
#- "{{ansible_hostname}}"
|
||||||
|
- "man-dan-03"
|
||||||
|
|
||||||
|
- name: Generate a Self Signed OpenSSL certificate
|
||||||
|
openssl_certificate:
|
||||||
|
path: "{{gitlab_dir[4]}}/gitlab.cer"
|
||||||
|
privatekey_path: "{{gitlab_dir[4]}}/gitlab.key"
|
||||||
|
csr_path: "{{gitlab_dir[4]}}/gitlab.csr"
|
||||||
|
provider: selfsigned
|
||||||
|
entrust_not_after: 365d
|
||||||
|
|
||||||
#- name: deploy Docker Compose stack
|
#- name: deploy Docker Compose stack
|
||||||
# docker_compose:
|
# docker_compose:
|
||||||
|
|||||||
19
gitlab/roles/docker_gitlab/templates/docker-compose.yml.j2
Normal file → Executable file
19
gitlab/roles/docker_gitlab/templates/docker-compose.yml.j2
Normal file → Executable file
@@ -1,17 +1,28 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
services:
|
services:
|
||||||
web:
|
gitlab:
|
||||||
image: 'gitlab/gitlab-ce:latest'
|
image: 'gitlab/gitlab-ce:latest'
|
||||||
restart: always
|
restart: unless-stopped
|
||||||
hostname: 'localhost'
|
hostname: 'localhost'
|
||||||
container_name: gitlab-ce
|
container_name: gitlab-ce
|
||||||
environment:
|
environment:
|
||||||
|
GITLAB_ROOT_PASSWORD: 'Start1234!'
|
||||||
GITLAB_OMNIBUS_CONFIG: |
|
GITLAB_OMNIBUS_CONFIG: |
|
||||||
external_url 'http://{{ansible_host}}:{{web_port}}'
|
gitlab_rails['time_zone'] = 'Europe/Berlin'
|
||||||
|
external_url 'https://{{gitlab_hostname}}'
|
||||||
gitlab_rails['gitlab_shell_ssh_port'] = {{ssh_port}}
|
gitlab_rails['gitlab_shell_ssh_port'] = {{ssh_port}}
|
||||||
|
nginx['listen_port'] = 443
|
||||||
|
nginx['redirect_http_to_https'] = true
|
||||||
|
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.cer"
|
||||||
|
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.key"
|
||||||
|
nginx['ssl_protocols'] = "TLSv1.1 TLSv1.2"
|
||||||
|
registry_external_url 'https://registry.{{gitlab_hostname}}'
|
||||||
|
registry['registry_http_addr'] = "0.0.0.0:5000"
|
||||||
|
registry_nginx['enable'] = false
|
||||||
ports:
|
ports:
|
||||||
- '{{web_port}}:8929'
|
- '{{http_ssl}}:443'
|
||||||
- '{{ssh_port}}:22'
|
- '{{ssh_port}}:22'
|
||||||
|
- '5000:5000'
|
||||||
volumes:
|
volumes:
|
||||||
- '{{gitlab_dir[1]}}:/etc/gitlab'
|
- '{{gitlab_dir[1]}}:/etc/gitlab'
|
||||||
- '{{gitlab_dir[2]}}:/var/log/gitlab'
|
- '{{gitlab_dir[2]}}:/var/log/gitlab'
|
||||||
|
|||||||
3
gitlab/roles/docker_gitlab/vars/main.yml
Normal file → Executable file
3
gitlab/roles/docker_gitlab/vars/main.yml
Normal file → Executable file
@@ -1,3 +1,4 @@
|
|||||||
web_port: 8929
|
web_port: 80
|
||||||
|
http_ssl: 443
|
||||||
ssh_port: 2222
|
ssh_port: 2222
|
||||||
shm_size: "1024m"
|
shm_size: "1024m"
|
||||||
|
|||||||
0
gitlab/roles/prereq_gitlab/README.md
Normal file → Executable file
0
gitlab/roles/prereq_gitlab/README.md
Normal file → Executable file
7
gitlab/roles/prereq_gitlab/defaults/main.yml
Normal file → Executable file
7
gitlab/roles/prereq_gitlab/defaults/main.yml
Normal file → Executable file
@@ -1,8 +1 @@
|
|||||||
---
|
---
|
||||||
# defaults file for roles/prereq-portainer
|
|
||||||
# portainer direcotorys
|
|
||||||
|
|
||||||
#portainer_dir:
|
|
||||||
# - "/home/{{ansible_user}}/.portainer"
|
|
||||||
# - "/home/{{ansible_user}}/.portainer/cert"
|
|
||||||
# - "/home/{{ansible_user}}/.portainer/data"
|
|
||||||
1
gitlab/roles/prereq_gitlab/handlers/main.yml
Normal file → Executable file
1
gitlab/roles/prereq_gitlab/handlers/main.yml
Normal file → Executable file
@@ -1,2 +1 @@
|
|||||||
---
|
---
|
||||||
# handlers file for roles/prereq-portainer
|
|
||||||
|
|||||||
0
gitlab/roles/prereq_gitlab/meta/main.yml
Normal file → Executable file
0
gitlab/roles/prereq_gitlab/meta/main.yml
Normal file → Executable file
0
gitlab/roles/prereq_gitlab/tasks/main.yml
Normal file → Executable file
0
gitlab/roles/prereq_gitlab/tasks/main.yml
Normal file → Executable file
0
gitlab/roles/prereq_gitlab/vars/main.yml
Normal file → Executable file
0
gitlab/roles/prereq_gitlab/vars/main.yml
Normal file → Executable file
Reference in New Issue
Block a user