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]
### Added
- feat: add gitlab_data_dir variable
## [v1.0.0] - 2020-04-11
- first version

View file

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

View file

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

View file

@ -4,6 +4,11 @@ def test_packages(host):
package = host.package('gitlab-ce')
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):
config = host.file('/etc/gitlab/gitlab.rb')
assert config.exists

View file

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