Migration commit

This commit is contained in:
sonny 2024-10-22 10:07:52 +02:00
parent 1ddd045a6c
commit 68c834a60a
4 changed files with 55 additions and 43 deletions

View file

@ -1,6 +1,57 @@
- hosts: localhost
tasks:
- import_tasks: 'tasks.yml'
- 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'