2020-02-07 08:57:48 +00:00
|
|
|
- name: Include gitea variables
|
|
|
|
include_vars: gitea.yml
|
|
|
|
|
|
|
|
- name: Create gitea directory
|
|
|
|
file:
|
2020-03-25 21:27:15 +00:00
|
|
|
path: /opt/gitea
|
2020-02-07 08:57:48 +00:00
|
|
|
state: directory
|
|
|
|
owner: "{{ docker_user.name }}"
|
|
|
|
mode: "{{ docker_compose_directory_mask }}"
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Create gitea config directory
|
|
|
|
file:
|
2020-03-25 21:27:15 +00:00
|
|
|
path: /opt/gitea/gitea/gitea/conf
|
2020-02-07 08:57:48 +00:00
|
|
|
state: directory
|
|
|
|
mode: "{{ docker_compose_directory_mask }}"
|
|
|
|
become: true
|
|
|
|
|
2020-02-17 21:46:50 +00:00
|
|
|
- name: Create cgit config directory
|
|
|
|
file:
|
2020-03-25 21:27:15 +00:00
|
|
|
path: /opt/gitea/cgit
|
2020-02-17 21:46:50 +00:00
|
|
|
state: directory
|
|
|
|
mode: "{{ docker_compose_directory_mask }}"
|
|
|
|
become: true
|
|
|
|
|
2020-02-07 08:57:48 +00:00
|
|
|
- name: Install gitea compose file
|
|
|
|
template:
|
|
|
|
src: files/gitea/docker-compose.yml
|
2020-03-25 21:27:15 +00:00
|
|
|
dest: /opt/gitea/docker-compose.yml
|
2020-02-07 08:57:48 +00:00
|
|
|
mode: "{{ docker_compose_file_mask }}"
|
|
|
|
owner: "{{ docker_user.name }}"
|
|
|
|
validate: /usr/bin/docker-compose -f %s config
|
|
|
|
register: compose_file
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Install gitea config file
|
|
|
|
template:
|
|
|
|
src: files/gitea/app.ini
|
2020-03-25 21:27:15 +00:00
|
|
|
dest: /opt/gitea/gitea/gitea/conf/app.ini
|
2020-02-07 08:57:48 +00:00
|
|
|
mode: "{{ docker_compose_file_mask }}"
|
|
|
|
owner: "{{ docker_user.name }}"
|
2020-02-17 21:46:50 +00:00
|
|
|
register: gitea_config_file
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Install cgit config file
|
|
|
|
template:
|
|
|
|
src: files/gitea/cgitrc
|
2020-03-25 21:27:15 +00:00
|
|
|
dest: /opt/gitea/cgit/cgitrc
|
2020-02-17 21:46:50 +00:00
|
|
|
mode: "{{ docker_compose_file_mask }}"
|
|
|
|
owner: "{{ docker_user.name }}"
|
|
|
|
register: cgit_config_file
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Touch public repos file
|
|
|
|
file:
|
|
|
|
path: /opt/gitea/cgit/repos.txt
|
|
|
|
state: file
|
2020-02-07 08:57:48 +00:00
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Cycle gitea container
|
|
|
|
docker_compose:
|
|
|
|
project_src: /opt/gitea
|
|
|
|
pull: true
|
|
|
|
remove_orphans: true
|
|
|
|
remove_volumes: true
|
|
|
|
state: "{{ item }}"
|
2020-02-17 21:46:50 +00:00
|
|
|
when: compose_file.changed or gitea_config_file.changed or cgit_config_file.changed
|
2020-02-07 08:57:48 +00:00
|
|
|
loop:
|
|
|
|
- absent
|
|
|
|
- present
|