This repository contains ansible scripts to manage Gitlab installations on Docker. The scripts can handle:
- Backup and Upgrading of
Gitlab - Restoring backups TODO
- Scheduling backups via crontab TODO
You may run the script via the docker-compose.yml file. It uses the cytopia/ansible:2.13-tools ansible docker image to run the ansible script against your Docker/Docker Swarm Manager node.
This ansible container should have network access to your node, as it uses SSH to propogate the instructions.
The script will also need an ssh key to access your node
- Edit
hosts.yml<HOST_IP>: Replace this with the address of yourDocker/Docker Swarm Managernode<USER>: Replace this with the user's username of yourDocker/Docker Swarm Managernode
- Add the private key for your
SSHkey namedkey.peminto the root directory of this repo - Build the image -
docker compose build - Run the
upgrade-gitlabscript -docker compose run upgrade-gitlab - Enter the following into the script's prompts:
- Docker Swarm Gitlab service name: The name of your docker service (from Portainer/
docker service ls) - The current Gitlab image tag: e.g.
docker.io/gitlab/gitlab-ce:16.2.2-ce.0 - The target Gitlab image tag to upgrade to: e.g.
docker.io/gitlab/gitlab-ce:16.8.0-ce.0
- Docker Swarm Gitlab service name: The name of your docker service (from Portainer/
Note: the script will only update the
Docker Swarmservice to use the target image. After all upgrades are complete, you will need to manually update yourDocker Swarm Stack/docker-compose.ymldefinition to use the target image.