|
|
||
|---|---|---|
| defaults | ||
| handlers | ||
| meta | ||
| tasks | ||
| templates | ||
| tests | ||
| .ansible-lint | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
README.md
Forgejo
A role that installs forgejo, the
self-hosted lightweight software forge. The role downloads the forgejo
binary, creates the service user and the directory layout, and installs
the systemd unit from a template so that optional dependencies
(memcached, redis, a local database) can be declared as
Wants=/After= directives.
The application configuration (app.ini) is not
managed by this role.
Requirements
None. git and git-lfs are installed by the
role.
Role Variables
The most important variables are listed below:
forgejo_version: 10.0.0
forgejo_arch: linux-amd64
forgejo_download_url: 'https://codeberg.org/forgejo/forgejo/releases/download/{{ forgejo_tag }}/forgejo-{{ forgejo_version }}-{{ forgejo_arch }}'
# Set it to true to download the binary again even when it is already there
forgejo_force_binary_download: false
forgejo_bin_path: /usr/local/bin/forgejo
# The service user. forgejo upstream uses the 'git' user
git_create_service_user: true
git_user: git
git_group: '{{ git_user }}'
git_home: /home/git
# FORGEJO_WORK_DIR, and where app.ini lives
forgejo_work_dir: /var/lib/forgejo
forgejo_conf_dir: /etc/forgejo
forgejo_enabled: true
forgejo_service_name: forgejoSystemd unit tuning:
# Raise it if you have repositories with a lot of files and you get HTTP 500
# errors because of that
forgejo_limit_nofile: ''
# Set it when forgejo listens on a unix socket: systemd creates /run/<dir>
forgejo_runtime_dir: ''
# Set it if git and/or git-lfs are not installed inside the default PATH
forgejo_path_env: ''
# Set it to true to let forgejo bind ports below 1024
forgejo_bind_privileged_ports: falseService dependencies. Every service enabled below is added to the
systemd unit as a Wants=/After= pair:
forgejo_local_postgresql: false
forgejo_local_mysql: false
forgejo_local_mariadb: false
forgejo_local_memcache: false
forgejo_local_redis: false
# Any other unit, by name
forgejo_service_dependencies_adjunct: []The unit names can be overridden when they differ from the
distribution defaults: forgejo_redis_service_name,
forgejo_memcached_service_name,
forgejo_postgresql_service_name,
forgejo_mysql_service_name,
forgejo_mariadb_service_name.
Tags
forgejo: everythingforgejo_binary: the binary download onlyforgejo_service: the systemd unit and the service state onlyforgejo_prepare: download the app.example.ini and save the variables of the Forgejo configuration as variables of the role.forgejo_conf: apply the template forgejo.ini.j2 to save the configuration file app.ini reading the vars/main variables.
Dependencies
The memcached and redis roles, installed
only when forgejo_local_memcache and/or
forgejo_local_redis are true.
Example Playbook
- hosts: forgejo-servers
roles:
- role: forgejo
forgejo_version: 10.0.0
forgejo_local_postgresql: true
forgejo_local_redis: true
forgejo_local_memcache: trueLicense
EUPL-1.2
Author Information
Andrea Dell’Amico, andrea.dellamico@isti.cnr.it Franca Debole, franca.debole@isti.cnr.it