ansible-gitea-role/tasks/main.yml

53 lines
1.1 KiB
YAML
Raw Normal View History

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
ansible.builtin.get_url:
url: "{{ gitea_dl_url }}"
dest: /usr/local/bin/gitea
mode: 755
owner: root
group: root
- 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