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'

View file

@ -1,39 +0,0 @@
- 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
become: true
template:
src: 'templates/docker-compose.j2'
dest: '{{ app_dir }}/docker-compose.yml'
owner: 'sonny'
group: 'sonny'
mode: '0755'
- name: stop gitlab
docker_compose:
project_src: '{{ app_dir }}'
state: absent
environment:
GITLAB_HOME: '{{ gitlab_home }}'
when: manage_docker is true
- name: start gitlab
docker_compose:
pull: true
project_src: '{{ app_dir }}'
environment:
GITLAB_HOME: '{{ gitlab_home }}'
when: manage_docker is true

View file

@ -1,4 +1,5 @@
version: '3.6'
# {{ ansible_managed }}
services:
web:
image: 'gitlab/gitlab-ee:{{ image_tag }}'

View file

@ -1,6 +1,5 @@
hostname: 'git.fudiggity.nl'
hostname: 'gitlab.fudiggity.nl'
manage_docker: false
image_tag: '17.2.1-ee.0'
runner_image_tag: 'alpine3.19-v17.1.1'