- name: Install gitea packages
community.general.pacman:
name: gitea
state: present
- name: Configure gitea
template:
src: templates/gitea_app.ini.j2
dest: /etc/gitea/app.ini
notify: Restart gitea
- name: Set data path
set_fact:
data_path: "{{ dataroot }}/gitea/"
- name: Create systemd override dir
file:
path: /etc/systemd/system/gitea.service.d/
state: directory
owner: root
group: root
mode: 0755
- name: Deploy systemd override conf
src: gitea.service.j2
dest: /etc/systemd/system/gitea.service.d/override.conf
mode: 0644
notify:
- Run daemon-reload for gitea
- Restart gitea
- name: Find owner of data folder
stat:
path: "{{ data_path }}"
register: data_folder
- name: Ensure data folder is under correct owner
recurse: yes
owner: gitea
group: gitea
when: data_folder.stat.pw_name != "gitea"
- name: Get gitea user information
user:
register: gitea_user
- name: Ensure gitea is stopped
service:
state: stopped
when: gitea_user.home != data_path[:-1]
- name: Change homedir of gitea
home: "{{ data_path }}"
- name: Enable gitea
state: started
enabled: yes