2023-04-14 20:27:41 +02:00
|
|
|
---
|
|
|
|
# tasks file for Ansible-Gitea-Role
|
2023-04-15 00:40:47 +02:00
|
|
|
|
|
|
|
- name: Ensure deps are installed
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name: "{{ gitea_deps }}"
|
|
|
|
|
|
|
|
- name: Download gitea binary
|
2024-04-11 09:57:41 +02:00
|
|
|
ansible.builtin.get_url:
|
|
|
|
url: "{{ gitea_dl_url }}"
|
2023-04-15 00:40:47 +02:00
|
|
|
dest: /usr/local/bin/gitea
|
2024-04-11 09:58:34 +02:00
|
|
|
force: true
|
2024-04-11 09:57:41 +02:00
|
|
|
mode: 755
|
2023-04-15 00:40:47 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
2023-05-04 11:05:35 +02:00
|
|
|
notify: Restart Gitea
|
2023-04-15 00:40:47 +02:00
|
|
|
|
|
|
|
- name: Create git user
|
|
|
|
ansible.builtin.user:
|
|
|
|
name: "{{ gitea_run_user }}"
|
|
|
|
system: true
|
|
|
|
shell: /bin/bash
|
2023-04-16 14:22:26 +02:00
|
|
|
home: "/home/{{ gitea_run_user }}"
|
2023-04-15 00:40:47 +02:00
|
|
|
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 }}"
|
2023-04-16 14:23:58 +02:00
|
|
|
notify: Restart Gitea
|
2023-04-15 00:40:47 +02:00
|
|
|
|
|
|
|
- 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
|
2023-04-19 16:44:00 +02:00
|
|
|
enabled: true
|
2023-04-15 00:40:47 +02:00
|
|
|
state: started
|