xoxys.gitea/tasks/install.yml

59 lines
1.5 KiB
YAML
Raw Normal View History

2018-12-08 22:21:48 +01:00
---
- name: Prepare base folder
file:
path: "{{ gitea_base_dir }}"
state: directory
owner: "{{ gitea_user }}"
group: "{{ gitea_user }}"
mode: 0750
become: True
become_user: root
- block:
- name: Prepare folder structure
file:
path: "{{ item }}"
state: directory
mode: 0750
loop:
- "{{ gitea_config_dir }}"
- "{{ gitea_data_dir }}"
- "{{ gitea_log_dir }}"
- "{{ gitea_template_dir }}/custom"
2018-12-08 22:21:48 +01:00
- name: Download Gitea binary
get_url:
2022-02-12 11:57:40 +01:00
url: "https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64"
dest: "{{ gitea_base_dir }}/gitea-latest"
mode: 0750
notify: __gitea_restart
2018-12-08 22:21:48 +01:00
2020-02-16 16:21:37 +01:00
- name: Copy config file
template:
src: "custom/conf/app.ini.j2"
dest: "{{ gitea_config_dir }}/app.ini"
mode: 0600
notify: __gitea_restart
- name: Copy template files
template:
src: "templates/custom/templates/custom/{{ item }}.tmpl.j2"
dest: "{{ gitea_template_dir }}/custom/{{ item }}.tmpl"
2020-02-16 16:21:37 +01:00
mode: 0600
loop:
- extra_links_footer
- extra_links
2020-02-16 16:21:37 +01:00
notify: __gitea_restart
2018-12-08 22:21:48 +01:00
become: True
become_user: "{{ gitea_user }}"
- block:
- name: Copy systemd unit file
template:
src: "etc/systemd/system/gitea.service.j2"
dest: "/etc/systemd/system/gitea.service"
2021-02-06 16:00:40 +01:00
mode: 0640
notify: __gitea_restart
2018-12-08 22:21:48 +01:00
become: True
become_user: root