2022-03-04 05:15:25 +00:00
|
|
|
---
|
2022-05-08 22:58:43 +00:00
|
|
|
- name: Check for gitea.configured
|
2022-11-08 22:18:02 +00:00
|
|
|
ansible.builtin.stat:
|
2022-05-08 22:58:43 +00:00
|
|
|
path: "/etc/gitea.configured"
|
|
|
|
register: gitea_configured_file
|
|
|
|
check_mode: false
|
|
|
|
changed_when: "1 != 1"
|
|
|
|
tags:
|
|
|
|
- mock
|
|
|
|
|
|
|
|
- name: Deploy Gitea configuration
|
2022-11-08 22:18:02 +00:00
|
|
|
ansible.builtin.template:
|
2022-05-08 22:58:43 +00:00
|
|
|
src: "etc/gitea/conf/app.ini.j2"
|
|
|
|
dest: "/etc/gitea/conf/app.ini"
|
|
|
|
owner: git
|
|
|
|
group: git
|
|
|
|
mode: '0660'
|
|
|
|
notify: restart_gitea
|
|
|
|
when:
|
|
|
|
- not gitea_configured_file.stat.exists|bool
|
|
|
|
|
2022-03-04 05:15:25 +00:00
|
|
|
# Configuration for gitea
|
2022-03-04 05:27:20 +00:00
|
|
|
- name: Enable Gitea
|
2022-03-28 00:53:47 +00:00
|
|
|
ansible.builtin.service:
|
2022-03-04 05:27:20 +00:00
|
|
|
name: gitea
|
|
|
|
state: started
|
|
|
|
enabled: true
|
2022-05-08 22:58:43 +00:00
|
|
|
when:
|
|
|
|
- not gitea_configured_file.stat.exists|bool
|
2022-03-04 05:27:20 +00:00
|
|
|
|
2023-01-04 01:49:30 +00:00
|
|
|
- name: Drop template direct for sign up link
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "var/lib/gitea/custom/templates/user/auth/signup.tmpl"
|
|
|
|
dest: "/var/lib/gitea/custom/templates/user/auth/signup.tmpl"
|
|
|
|
mode: '0644'
|
|
|
|
owner: git
|
|
|
|
group: git
|
|
|
|
|
2022-05-08 22:58:43 +00:00
|
|
|
- name: Drop file to prevent further configuration
|
|
|
|
ansible.builtin.file:
|
|
|
|
name: /etc/gitea.configured
|
|
|
|
state: touch
|
2022-06-02 21:22:36 +00:00
|
|
|
|
|
|
|
- name: Append AcceptEnv for openssh
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
create: true
|
|
|
|
path: /etc/ssh/sshd_config.d/99-gitea.conf
|
|
|
|
line: "AcceptEnv GIT_PROTOCOL"
|
2022-03-04 05:15:25 +00:00
|
|
|
...
|