Skip to content

Commit

Permalink
Merge branch 'mv-gitlab' of https://github.com/PurpleNinja225/NASible
Browse files Browse the repository at this point in the history
…into PurpleNinja225-mv-gitlab

* 'mv-gitlab' of https://github.com/PurpleNinja225/NASible:
  mv gitlab to role
  • Loading branch information
davestephens committed Mar 6, 2021
2 parents baf9889 + 322398f commit 2d5df19
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 20 deletions.
13 changes: 0 additions & 13 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ krusader_enabled: false
# Backup & Restore
timemachine_enabled: false

# Software build and CI
gitlab_enabled: false

# IRC
thelounge_enabled: false

Expand Down Expand Up @@ -286,16 +283,6 @@ stat_collection_interval: 15s
grafana_influxdb_port: "8086"
grafana_port: "3000"


###
### Gitlab
###
gitlab_available_externally: "false"
gitlab_data_directory: "{{ docker_home }}/gitlab"
gitlab_port_http: "4080"
gitlab_port_https: "4443"
gitlab_port_ssh: "422"

###
### Guacamole
###
Expand Down
11 changes: 8 additions & 3 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,20 @@
- firefly
when: (firefly_enabled | default(False))

- role: get_iplayer
tags:
- get_iplayer
when: (get_iplayer_enabled | default(False))

- role: gitea
tags:
- gitea
when: (gitea_enabled | default(False))

- role: get_iplayer
- role: gitlab
tags:
- get_iplayer
when: (get_iplayer_enabled | default(False))
- gitlab
when: (gitlab_enabled | default(False))

- role: glances
tags:
Expand Down
16 changes: 16 additions & 0 deletions roles/gitlab/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# enable or disable the application
gitlab_enabled: false
gitlab_available_externally: "false"

# directories
gitlab_data_directory: "{{ docker_home }}/gitlab"

# network
gitlab_hostname: "gitlab"
gitlab_port_http: "4080"
gitlab_port_https: "4443"
gitlab_port_ssh: "422"

# specs
gitlab_memory: "4g"
23 changes: 19 additions & 4 deletions tasks/gitlab.yml → roles/gitlab/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
create_home: no
group: gitlab

- name: Create Gitlab user account
user:
name: gitlab
uid: 998
state: present
system: yes
update_password: on_create
create_home: no
group: gitlab

- name: Create Gitlab Directories
file:
path: "{{ item }}"
Expand All @@ -27,7 +37,7 @@
- "{{ gitlab_data_directory }}/log"
- "{{ gitlab_data_directory }}/data"

- name: Create Gitlab container
- name: Create Gitlab Docker Container
docker_container:
name: gitlab
image: gitlab/gitlab-ce:latest
Expand All @@ -36,16 +46,21 @@
- "{{ gitlab_data_directory }}/config:/etc/gitlab:rw"
- "{{ gitlab_data_directory }}/log:/var/log/gitlab:rw"
- "{{ gitlab_data_directory }}/data:/var/opt/gitlab:rw"
network_mode: "bridge"
ports:
- "{{ gitlab_port_http }}:80"
- "{{ gitlab_port_https }}:443"
- "{{ gitlab_port_ssh }}:22"
hostname: "gitlab.{{ ansible_nas_domain }}"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ gitlab_user_id }}"
PGID: "{{ gitlab_group_id }}"
restart_policy: unless-stopped
memory: 4g
hostname: "{{ gitlab_hostname }}.{{ ansible_nas_domain }}"
memory: "{{ gitlab_memory }}"
labels:
traefik.enable: "{{ gitlab_available_externally }}"
traefik.http.routers.gitlab.rule: "Host(`gitlab.{{ ansible_nas_domain }}`)"
traefik.http.routers.gitlab.rule: "Host(`{{ gitlab_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.gitlab.tls.certresolver: "letsencrypt"
traefik.http.routers.gitlab.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.gitlab.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
Expand Down

0 comments on commit 2d5df19

Please sign in to comment.