No description
Find a file
Jesus Alejandro Sanchez Davila 1c0142c015 Revision of the whole forgejo role
2026-05-21 18:42:21 +02:00
changelogs Initial commit 2026-05-20 12:59:39 +02:00
meta Initial commit 2026-05-20 12:59:39 +02:00
playbooks Initial commit 2026-05-20 12:59:39 +02:00
plugins Initial commit 2026-05-20 12:59:39 +02:00
roles Revision of the whole forgejo role 2026-05-21 18:42:21 +02:00
AGENT.md Initial commit 2026-05-20 12:59:39 +02:00
galaxy.yml Initial commit 2026-05-20 12:59:39 +02:00
README.md Initial commit 2026-05-20 12:59:39 +02:00

Ansible Collection — silvarion.repos

Namespace: silvarion Collection: repos (distributed as silvarion.git) License: GPL-2.0-or-later


Description

Deploys and configures FOSS Git hosting platforms on Linux servers and LXC containers. Handles binary installation, service user management, database configuration (internal or external), and systemd service setup.


Supported Platforms

Distribution Versions
Alma Linux 8, 9
Rocky Linux 8, 9
Ubuntu 20.04, 22.04, 24.04
Debian 11 (bullseye), 12 (bookworm)

Roles

Role Description Status
forgejo Install and configure Forgejo (Gitea fork) Active
gitea Install and configure Gitea Planned
gitlab Install and configure GitLab CE Planned
onedev Install and configure OneDev Active

Requirements

  • Ansible >= 2.15
  • gather_facts: true on all plays (roles rely on ansible_facts)
  • become: true (package installation and service management require root)

Installation

From Ansible Galaxy

ansible-galaxy collection install silvarion.git

From Source

git clone https://git.silvarion.org/silvarion/ansible-collections/silvarion.repos.git
ansible-galaxy collection install ./silvarion.repos --force

Quick Start

Forgejo with SQLite (default)

---
- name: Deploy Forgejo
  hosts: forgejo_servers
  gather_facts: true
  become: true

  roles:
    - role: silvarion.git.forgejo
      vars:
        forgejo_domain: git.example.com
        forgejo_http_port: 3000
        forgejo_secret_key: "{{ vault_forgejo_secret_key }}"
        forgejo_internal_token: "{{ vault_forgejo_internal_token }}"

Forgejo with PostgreSQL (managed internally)

---
- name: Deploy Forgejo with PostgreSQL
  hosts: forgejo_servers
  gather_facts: true
  become: true

  roles:
    - role: silvarion.git.forgejo
      vars:
        forgejo_domain: git.example.com
        forgejo_db_type: postgres
        forgejo_db_internal: true
        forgejo_db_name: forgejo
        forgejo_db_user: forgejo
        forgejo_db_password: "{{ vault_forgejo_db_password }}"
        forgejo_secret_key: "{{ vault_forgejo_secret_key }}"
        forgejo_internal_token: "{{ vault_forgejo_internal_token }}"

Forgejo with External Database

---
- name: Deploy Forgejo with External DB
  hosts: forgejo_servers
  gather_facts: true
  become: true

  roles:
    - role: silvarion.git.forgejo
      vars:
        forgejo_domain: git.example.com
        forgejo_db_type: postgres
        forgejo_db_internal: false
        forgejo_db_host: "db.internal:5432"
        forgejo_db_name: forgejo
        forgejo_db_user: forgejo
        forgejo_db_password: "{{ vault_forgejo_db_password }}"
        forgejo_db_ssl_mode: require
        forgejo_secret_key: "{{ vault_forgejo_secret_key }}"
        forgejo_internal_token: "{{ vault_forgejo_internal_token }}"

Dependencies

This collection optionally uses:

Collection Used when
silvarion.databases forgejo_db_internal: true with mysql or postgres backend

Collection Dependencies

Declared in galaxy.yml. Install all requirements with:

ansible-galaxy collection install -r requirements.yml

Linting

yamllint .
ansible-lint --show-relpath

Testing

cd roles/forgejo
molecule test

Changelog

See CHANGELOG.rst (generated by antsibull-changelog).


License

GPL-2.0-or-later


Author

Jesus Alejandro Sanchez Davila