ansible-gitea-role/tasks/main.yml

54 lines
1.2 KiB
YAML

---
# tasks file for Ansible-Gitea-Role
- name: Ensure deps are installed
ansible.builtin.apt:
name: "{{ gitea_deps }}"
- name: Download gitea binary
ansible.builtin.get_url:
url: "{{ gitea_dl_url }}"
dest: /usr/local/bin/gitea
mode: 755
owner: root
group: root
notify: Restart Gitea
- name: Create git user
ansible.builtin.user:
name: "{{ gitea_run_user }}"
system: true
shell: /bin/bash
home: "/home/{{ gitea_run_user }}"
create_home: true
- name: Create Gitea folders
ansible.builtin.file:
path: "{{ item.path }}"
mode: "{{ item.mode }}"
owner: "{{ item.user }}"
group: "{{ item.group }}"
loop: "{{ gitea_init_folders }}"
- name: Update Gitea config
ansible.builtin.template:
src: app.ini.j2
dest: /etc/gitea/app.ini
mode: "640"
owner: root
group: "{{ gitea_run_user }}"
notify: Restart Gitea
- name: Add service file
ansible.builtin.template:
src: gitea.service.j2
dest: /etc/systemd/system/gitea.service
mode: "644"
- name: Enable and start Gitea service
ansible.builtin.systemd:
name: gitea
daemon_reload: true
enabled: true
state: started