Compare commits

..

10 Commits

Author SHA1 Message Date
499daebb0c commit message from python script 2023-12-01 16:43:58 +01:00
d6d816665c commit message from python script 2023-11-29 21:26:44 +01:00
e2d802b963 commit message from python script 2023-11-29 16:26:25 +01:00
6389205bed commit message from python script 2023-11-29 11:25:44 +01:00
5ae277dd3f fix error 2023-10-18 21:14:00 +02:00
062c0b9c6c fix error 2023-10-18 20:19:31 +02:00
428cda4bf8 added 2023-10-18 20:13:04 +02:00
6f5b0fb21d commit message from python script 2023-10-18 17:45:48 +02:00
db3760cb35 commit message from python script 2023-07-14 17:54:39 +02:00
2927b066a5 added 2023-04-11 16:27:22 +02:00
14 changed files with 64 additions and 25 deletions

0
gitlab/README.md Normal file → Executable file
View File

View File

@@ -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
View 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
View File

35
gitlab/roles/docker_gitlab/tasks/main.yml Normal file → Executable file
View 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:

View 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
View 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
View File

7
gitlab/roles/prereq_gitlab/defaults/main.yml Normal file → Executable file
View 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
View File

@@ -1,2 +1 @@
--- ---
# handlers file for roles/prereq-portainer

0
gitlab/roles/prereq_gitlab/meta/main.yml Normal file → Executable file
View File

0
gitlab/roles/prereq_gitlab/tasks/main.yml Normal file → Executable file
View File

0
gitlab/roles/prereq_gitlab/vars/main.yml Normal file → Executable file
View File