feat: add gitlab_data_dir variable

This commit is contained in:
Adrien Waksberg 2021-08-24 07:59:04 +02:00
parent a4bb62b56c
commit b6600b4d77
5 changed files with 13 additions and 0 deletions

View file

@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
## [Unreleased] ## [Unreleased]
### Added
- feat: add gitlab_data_dir variable
## [v1.0.0] - 2020-04-11 ## [v1.0.0] - 2020-04-11
- first version - first version

View file

@ -13,6 +13,7 @@ Install and configure a Gitlab server
## Role variables ## Role variables
- `gitlab_url` - set the gitlab url (default: `http://gitlab.example.com`) - `gitlab_url` - set the gitlab url (default: `http://gitlab.example.com`)
- `gitlab_data_dir` - set the path for repository
- `gitlab_config` - set the config - `gitlab_config` - set the config
``` ```

View file

@ -4,6 +4,7 @@
roles: roles:
- ansible-role-gitlab - ansible-role-gitlab
vars: vars:
gitlab_data_dir: /opt/data/git
gitlab_config: gitlab_config:
prometheus: prometheus:
enable: false enable: false

View file

@ -4,6 +4,11 @@ def test_packages(host):
package = host.package('gitlab-ce') package = host.package('gitlab-ce')
assert package.is_installed assert package.is_installed
def test_git_directory(host):
path = host.file('/opt/data/git')
assert path.exists
assert path.is_directory
def test_config_file(host): def test_config_file(host):
config = host.file('/etc/gitlab/gitlab.rb') config = host.file('/etc/gitlab/gitlab.rb')
assert config.exists assert config.exists

View file

@ -1,12 +1,14 @@
# {{ ansible_managed }} # {{ ansible_managed }}
external_url '{{ gitlab_url }}' external_url '{{ gitlab_url }}'
{% if gitlab_data_dir is defined %}
git_data_dirs({ git_data_dirs({
"default" => { "default" => {
"path" => "{{ gitlab_data_dir }}" "path" => "{{ gitlab_data_dir }}"
} }
}) })
{% endif %}
{% for module, options in gitlab_config.items() %} {% for module, options in gitlab_config.items() %}
{% for option, value in options.items() %} {% for option, value in options.items() %}