2026-01-13 23:00:46 -08:00
|
|
|
---
|
|
|
|
|
# Note: forgejo config at /opt/homebrew/var/forgejo/custom/conf/app.ini
|
|
|
|
|
# is not managed here (contains secrets). It is backed up by borgmatic.
|
|
|
|
|
|
|
|
|
|
- name: Install forgejo via homebrew
|
|
|
|
|
community.general.homebrew:
|
|
|
|
|
name: forgejo
|
|
|
|
|
state: present
|
|
|
|
|
|
|
|
|
|
- name: Check forgejo config exists
|
|
|
|
|
ansible.builtin.stat:
|
|
|
|
|
path: /opt/homebrew/var/forgejo/custom/conf/app.ini
|
|
|
|
|
register: forgejo_config
|
|
|
|
|
|
|
|
|
|
- name: Fail if forgejo config is missing
|
|
|
|
|
ansible.builtin.fail:
|
|
|
|
|
msg: |
|
|
|
|
|
Forgejo config not found at /opt/homebrew/var/forgejo/custom/conf/app.ini
|
|
|
|
|
This file contains secrets and is not managed by ansible.
|
|
|
|
|
To restore from backup, run:
|
2026-01-16 19:33:02 -08:00
|
|
|
borgmatic --config ~/.config/borgmatic/config.yaml extract --archive latest \
|
|
|
|
|
--path /opt/homebrew/var/forgejo/custom/conf/app.ini
|
2026-01-13 23:00:46 -08:00
|
|
|
when: not forgejo_config.stat.exists
|
|
|
|
|
|
|
|
|
|
- name: Ensure forgejo service is started
|
|
|
|
|
ansible.builtin.command: brew services start forgejo
|
2026-01-16 19:33:02 -08:00
|
|
|
register: forgejo_brew_start
|
|
|
|
|
changed_when: "'Successfully started' in forgejo_brew_start.stdout"
|
2026-01-13 23:00:46 -08:00
|
|
|
failed_when: false
|