This repository has been archived on 2025-04-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
gitlab/playbook.yml
2024-10-22 10:07:52 +02:00

57 lines
1.4 KiB
YAML

- hosts: localhost
tasks:
- name: create gitlab home directory
file:
path: '{{ gitlab_home }}'
state: directory
mode: '0755'
- name: create gitlab app directory
become: true
file:
path: '{{ app_dir }}'
state: directory
mode: '0755'
owner: 'sonny'
group: 'sonny'
- name: copy docker-compose file
template:
src: 'templates/docker-compose.j2'
dest: '{{ app_dir }}/docker-compose.yml'
owner: 'sonny'
group: 'sonny'
mode: '0755'
- name: stop gitlab
command: docker compose --file docker-compose.yml down
args:
chdir: '{{ app_dir }}'
environment:
GITLAB_HOME: '{{ gitlab_home }}'
- name: pull gitlab {{ image_tag }}
command: docker compose --file docker-compose.yml pull
args:
chdir: '{{ app_dir }}'
- name: start gitlab
command: docker compose --file docker-compose.yml up --detach
args:
chdir: '{{ app_dir }}'
environment:
GITLAB_HOME: '{{ gitlab_home }}'
- name: reconfigure gitlab
command: >
docker compose
--file docker-compose.yml
exec --interactive --tty web gitlab-ctl reconfigure
args:
chdir: '{{ app_dir }}'
environment:
GITLAB_HOME: '{{ gitlab_home }}'
vars_files:
- 'vars/main.yml'
- 'vars/email.yml'