git push origin masterMerge branch 'DLLarson-gitlab-work'

* DLLarson-gitlab-work:
  Update Gitlab container options
  Add Gitlab to available AnsibleNAS packages.
This commit is contained in:
David Stephens 2020-02-07 22:43:43 +00:00
commit fe5377194a
7 changed files with 84 additions and 1 deletions

View file

@ -44,7 +44,8 @@ Ansible config and a bunch of Docker containers.
* [Emby](https://emby.media/) - Media streaming and management
* [Firefly III](https://firefly-iii.org/) - Free and open source personal finance manager
* [get_iplayer](https://github.com/get-iplayer/get_iplayer) - download programmes from BBC iplayer
* [Gitea](https://gitea.io/en-us/) - Self-hosted Github clone
* [Gitea](https://gitea.io/en-us/) - Simple self-hosted Github clone
* [Gitlab](https://about.gitlab.com/features/) - Self-hosted Github clone of the highest order
* [Glances](https://nicolargo.github.io/glances/) - for seeing the state of your system via a web browser
* [Grafana](https://github.com/grafana/grafana) - Dashboarding tool
* [Guacamole](https://guacamole.apache.org/) - Web based remote desktop gateway, supports VNC, RDP and SSH

View file

@ -0,0 +1,14 @@
# GitLab
Homepage: [https://docs.gitlab.com/omnibus/docker/](https://docs.gitlab.com/omnibus/docker/)
If Gitea isn't powerful enough for you then consider GitLab. It's a much more powerful (and consquently bigger) Git repository solution that includes a suite of code analytics. On the other hand it requires more RAM.
## Usage
Set `gitlab_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
To make GitLab available externally via Traefik set `gitlab_available_externally: "true"` in your `inventories/<your_inventory>/nas.yml` file.
The first time you run GitLab you'll be prompted for an account's password. The password is for GitLab's `root` administrator account. From there you can log in to create additional users and further configure the application.

View file

@ -18,6 +18,9 @@ By default, applications can be found on the ports listed below.
| get_iplayer | 8182 | |
| Gitea | 3001 | Web |
| Gitea | 222 | SSH |
| Gitlab | 4080 | HTTP |
| Gitlab | 4443 | HTTPS |
| Gitlab | 422 | SSH |
| Glances | 61208 | SSH |
| Grafana | 3000 | |
| Guacamole | 8090 | |

View file

@ -65,6 +65,7 @@ timemachine_enabled: false
# Software build and CI
gitea_enabled: false
gitlab_enabled: false
# IRC
znc_enabled: false
@ -568,6 +569,15 @@ gitea_data_directory: "{{ docker_home }}/gitea"
gitea_port_http: "3001"
gitea_port_ssh: "222"
###
### Gitlab
###
gitlab_available_externally: "false"
gitlab_data_directory: "{{ docker_home }}/gitlab"
gitlab_port_http: "4080"
gitlab_port_https: "4443"
gitlab_port_ssh: "422"
###
### Glances
###

View file

@ -120,6 +120,10 @@
when: (gitea_enabled | default(False))
tags: gitea
- import_tasks: tasks/gitlab.yml
when: (gitlab_enabled | default(False))
tags: gitlab
- import_tasks: tasks/timemachine.yml
when: (timemachine_enabled | default(False))
tags: timemachine

50
tasks/gitlab.yml Normal file
View file

@ -0,0 +1,50 @@
---
# The gitlab uid/gid matches 'git:git' in the Gitlab Docker image.
- name: Create Gitlab group account
group:
name: gitlab
gid: 998
state: present
- 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 }}"
state: directory
owner: gitlab
group: gitlab
with_items:
- "{{ gitlab_data_directory }}/config"
- "{{ gitlab_data_directory }}/log"
- "{{ gitlab_data_directory }}/data"
- name: Create Gitlab container
docker_container:
name: gitlab
image: gitlab/gitlab-ce:latest
pull: true
volumes:
- "{{ gitlab_data_directory }}/config:/etc/gitlab:rw"
- "{{ gitlab_data_directory }}/log:/var/log/gitlab:rw"
- "{{ gitlab_data_directory }}/data:/var/opt/gitlab:rw"
ports:
- "{{ gitlab_port_http }}:80"
- "{{ gitlab_port_https }}:443"
- "{{ gitlab_port_ssh }}:22"
hostname: "gitlab.{{ ansible_nas_domain }}"
restart_policy: unless-stopped
memory: 4g
labels:
traefik.backend: "gitlab"
traefik.frontend.rule: "Host:gitlab.{{ ansible_nas_domain }}"
traefik.enable: "{{ gitlab_available_externally }}"
traefik.port: "80"

View file

@ -189,6 +189,7 @@ onDemand = false # create certificate when container is created
"emby.{{ ansible_nas_domain }}",
"firefly.{{ ansible_nas_domain }}",
"gitea.{{ ansible_nas_domain }}",
"gitlab.{{ ansible_nas_domain }}",
"glances.{{ ansible_nas_domain }}",
"grafana.{{ ansible_nas_domain }}",
"guacamole.{{ ansible_nas_domain }}",