ansible-gitea-management/tasks/gitea/configure.yml

42 lines
941 B
YAML
Raw Normal View History

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
- name: Enable Gitea
2022-03-28 00:53:47 +00:00
ansible.builtin.service:
name: gitea
state: started
enabled: true
2022-05-08 22:58:43 +00:00
when:
- not gitea_configured_file.stat.exists|bool
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
...