40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
---
|
|
- name: "set local variables from overrides and defaults"
|
|
set_fact:
|
|
gitea: "{{ (gitea_defaults | combine(gitea_override, recursive=True)) if gitea_override else gitea_defaults }}"
|
|
|
|
- name: ensure that path exists
|
|
file:
|
|
path: "{{ path }}/config/gitea"
|
|
state: directory
|
|
|
|
- name: template compose
|
|
template:
|
|
src: compose.yml.j2
|
|
dest: "{{ path }}/compose.yml"
|
|
|
|
- name: Copy ssh config
|
|
copy:
|
|
src: files/ssh
|
|
dest: "{{ path }}/config/gitea/ssh"
|
|
|
|
- import_role:
|
|
name: storage_mount
|
|
vars:
|
|
storagebox_override:
|
|
host: "{{ gitea.networkmount.host }}"
|
|
host_path: "{{ gitea.networkmount.host_path }}"
|
|
args: "{{ gitea.networkmount.args }}"
|
|
dest_path: "{{ gitea.data_path }}"
|
|
when: gitea.networkmount.host | length > 1
|
|
|
|
- name: ensure containers are running
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ path }}"
|
|
project_name: "{{ role_name }}"
|
|
state: "present"
|
|
pull: "always"
|
|
wait: true
|
|
services: [ 'gitea', 'db' ]
|
|
register: _compose_result
|