ansible-gitea-role/tasks/main.yml

52 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
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 }}"
recurse: true
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 }}"
- 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
state: started