An Ansible role to setup a Forgejo instance with Podman in rootless mode.
This repository has been archived on 2026-04-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
z3r0 7864f12ba2
All checks were successful
ci/woodpecker/push/release Pipeline was successful
ci: fix release step missing env variables
2025-10-26 21:35:15 +01:00
.woodpecker ci: fix release step missing env variables 2025-10-26 21:35:15 +01:00
defaults feat: add podman network toggle option 2025-10-26 17:17:43 +01:00
files feat: add domain and root_url config and robots.txt 2025-10-07 12:29:32 +02:00
handlers feat: run the entire service as a pod 2025-10-09 12:11:29 +02:00
meta Initial commit 2025-10-05 21:16:29 +02:00
tasks feat: add podman network toggle option 2025-10-26 17:17:43 +01:00
.ansible-lint Initial commit 2025-10-05 21:16:29 +02:00
.gitignore feat: run the entire service as a pod 2025-10-09 12:11:29 +02:00
.releaserc ci: add @fsl-s/semantic-release-forgejo plugin to semantic-release config 2025-10-26 21:30:38 +01:00
CHANGELOG.md chore(release): 1.4.0 [skip ci] 2025-10-26 16:18:32 +00:00
LICENSE Initial commit 2025-10-05 21:16:29 +02:00
README.md feat: add podman network toggle option 2025-10-26 17:17:43 +01:00
requirements.txt Initial commit 2025-10-05 21:16:29 +02:00

Ansible Role Forgejo

Ansible role to install a Forgejo instance via Podman in rootless mode.

Role Variables

exposed_http_port: "3000"

The port that the pod will expose for HTTP connections.

exposed_ssh_port: "2222"

The port that the pod will expose for SSH connections. Ignored if forgejo_disable_ssh is set to false.

forgejo_additional_ports: []

Additional port pairs to expose from the pod to the host. Example `["3333:3333", "1212:1212"]

forgejo_data_dir: "{{ forgejo_home_dir }}/forgejo-data"

The local folder that stores the forgejo data. It will be mounted on the /var/lib/gitea location of the forgejo-app container as binded volume.

forgejo_db_image_tag: "17"

The image tag of the Postgresql Database container.

forgejo_db_data_dir: "{{ forgejo_home_dir }}/db"

The local folder that stores the Postgresql data. It will be mounted on the /var/lib/postgresql/data location in the forgejo-db container as binded volume.

forgejo_db_username: forgejo

The owner username of the Forgejo database.

forgejo_db_password: changeme

The password of the Forgejo database owner.

forgejo_db_database: forgejo

The name of the database for Forgejo.

forgejo_disable_ssh: "false"

Same as DISABLE_SSH environment variable. See Forgejo's Configuration Cheat Sheet for additional info.

forgejo_server_domain: localhost

Same as FORGEJO__server__domain environment variable. See Forgejo's Configuration Cheat Sheet for additional info.

forgejo_server_root_url: "http ://{{ forgejo_server_domain }}:{{ forgejo_http_port }}"

Same as FORGEJO__server__ROOT_URL environment variable. See Forgejo's Configuration Cheat Sheet for additional info.

forgejo_home_dir: /home/forgejo

The home of the user that will run the container services.

forgejo_http_port: "3000"

The container exposed port of for Forgejo web access.

forgejo_image_tag: 12-rootless

The tag of the Forgejo rootless image.

forgejo_log_level: Info

Same as FORGEJO__log__LEVEL environment variable. See Forgejo's Configuration Cheat Sheet for additional info.

forgejo_ssh_port: "2222"

The container exposed port for SSH access to the Forgejo service. Used to clone repositories via SSH. Ignored if forgejo_disable_ssh is set to false.

podman_create_network: true

Creates a network for the containers running on the pod. If false then podman (the default network) will be used.

Dependencies

None.

Example Playbook

- hosts: servers

vars:
    forgejo_http_port: 3000
    forgejo_log_level: Warn
    forgejo_disable_ssh: "true"
    forgejo_server_domain: git.example.com
    forgejo_server_root_url: https://git.example.com

roles:
    - ansible-role-forgejo

License

GPLv3

Author Information

Created by z3r0.