ansible-gitea-management/tasks/gitea/configure.yml
2022-06-02 14:22:36 -07:00

42 lines
909 B
YAML

---
- name: Check for gitea.configured
stat:
path: "/etc/gitea.configured"
register: gitea_configured_file
check_mode: false
changed_when: "1 != 1"
tags:
- mock
- name: Deploy Gitea configuration
template:
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
# Configuration for gitea
- name: Enable Gitea
ansible.builtin.service:
name: gitea
state: started
enabled: true
when:
- not gitea_configured_file.stat.exists|bool
- name: Drop file to prevent further configuration
ansible.builtin.file:
name: /etc/gitea.configured
state: touch
- name: Append AcceptEnv for openssh
ansible.builtin.lineinfile:
create: true
path: /etc/ssh/sshd_config.d/99-gitea.conf
line: "AcceptEnv GIT_PROTOCOL"
...