Ansible role to install gitlab as docker service. This role is tested only on Ubuntu 16.04
- Docker
- Systemd
- python-docker package
- Create volume paths for docker container
- Setup gitlab config
- Setup systemd unit file
- Start/Restart gitlab service
Variable | Type | Mandatory? | Default | Description |
---|---|---|---|---|
image_name | text | no | gitlab/gitlab-ce | Docker image name |
image_version | text | no | 9.5.4-ce.0 | Docker image version |
interface | ip address | no | 0.0.0.0 | Mapped network for web-interface ports |
https_port | port | no | 443 | Mapped HTTPS port |
http_port | port | no | 80 | Mapped HTTP port |
ssh_port | port | no | 10022 | Mapped SSH port |
config_volume | path | no | Path to config volume | |
data_volume | path | no | Path to data volume | |
log_volume | path | no | Path to log volume | |
backup_volume | path | no | Path to backup volume | |
external_url | url | no | Gitlab Url, like git.example.org | |
ssh_host | host | no | SSH Host, like ssh.example.org | |
shell_ssh_port | host | no | Gitlab shell SSH port, like 10022 | |
email.enabled | boolean | no | false | Is mailing enabled? |
email.from | email address | no | Email from address | |
email.display_name | text | no | Email from name | |
email.reply_to | email address | no | Reply email address | |
email.subject_suffix | text | no | Suffix in email subject, like [GitLab] | |
smtp.address | host | no | SMTP server host | |
smtp.port | port | no | SMTP server port | |
smtp.user_name | text | no | SMTP user name | |
smtp.password | text | no | SMTP password | |
smtp.domain | text | no | SMTP domain | |
smtp.enable_starttls_auto | boolean | no | Is start-tls-auto enabled? | |
smtp.tls | boolean | no | Use TLS? | |
backup_keep_time | number | no | The duration in seconds to keep backups before they are allowed to be deleted |
Usage (without parameters):
- hosts: servers
roles:
- { role: install-docker-gitlab }
Usage (with parameters):
- hosts: servers
roles:
- role: install-docker-gitlab
config_volume: /srv/docker/gitlab/config
data_volume: /srv/docker/gitlab/data
log_volume: /srv/docker/gitlab/log
backup_volume: /srv/docker/gitlab/backups
external_url: http://vboxserver
ssh_host: vboxserver:10022
email:
enabled: true
from: '[email protected]'
display_name: 'Gitlab vboxserver'
reply_to: '[email protected]'
subject_suffix: '[Gitlab]'
smtp:
address: 'smtp.gmail.com'
port: 587
user_name: '[email protected]'
password: 'your_password'
domain: 'www.gmail.com'
enable_starttls_auto: true
tls: false