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

50 lines
1.2 KiB
YAML
Raw Permalink Normal View History

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