An Ansible role for ensuring the configuration of GitLab.
Requires Docker, private Docker Registry, Kubernetes, and MetalLb be installed.
Variable | Required | Default | Choices | Comments |
---|---|---|---|---|
docker_timeout | yes | 300 | Integer value | Number of seconds before docker pull timeout |
docker_retries | yes | 60 | Integer value | Number of tries for docker pull |
docker_delay | yes | 10 | Integer value | Delay in seconds between pull retries |
default_retries | yes | 60 | Integer value | Default number of retries |
default_delay | yes | 60 | Integer value | Default delay in seconds between retries |
gitlab_version | yes | 13.2.3 | tag | The sameersbn/gitlab image tag to deploy |
gitlab_host | yes | not defined | IP address | IP address to expose as |
gitlab_port | yes | 80 | Integer value | Port to listen on |
gitlab_ssh_port | yes | 10022 | Integer value | Port to listen on for SSH |
gitlab_user | yes | root | String value | The admin user |
vault_gitlab_root_password | yes | String value | The admin password store encrypted in an Ansible vault file | |
registry_host | yes | not defined | String value | IP address of private Docker registry |
registry_port | yes | not defined | Integer value | Port the private Docker registry listens on |
images_cache_path | no | not defined | Path | Path to folder used to cache saved Docker images |
cache_container_timeout | no | 300 seconds | Integer value | Number of seconds before Ansible times out |
An example can be found used in my Hands-on DevOps course's ansible/master-playbook.yml.
- hosts: masters
remote_user: vagrant
roles:
- common
- docker
- docker-compose
- docker-registry
- k3s-server
- docker-registry
- metallb
- gitlab
The above Ansible playbook uses my
- Common role to configure the instance past the base CentOS 7, Alpine 3.10 or Ubuntu Bionic image
- Docker role to install and configure Docker
- Docker-compose role to install Docker-compose
- Docker Registry role to install a private Docker registry
- K3s-server role to install Lightweight Kubernetes (K3s)
- metallb role to install MetalLB
- This role to install GitLab
For more information and to see this role put into action checkout my Hands-on DevOps class project.
The default admin user will be root
and can be set by the gitlab_user
password, whose password is set by vault_gitlab_root_password
. Please, ansible vault this variable.
3-Clause BSD License
Michael Joseph Walsh mjwalsh@nemonik.com