diff --git a/README.md b/README.md index 0e9d3c7..61fd7db 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,13 @@ The following code has been tested with the latest Debian Stable, it should work ----------- Here is a deeper insight into the variables of this gitea role. For the exact function of some variables and the possibility to add more options we recommend a look at this [config cheat sheet](https://docs.gitea.io/en-us/config-cheat-sheet/). +### Chose between gitea and forgejo +There is a fork of gitea called forgejo. Why? Read the [forgejo FAQ](https://forgejo.org/faq/). +You have the option to choose between [gitea](https://gitea.io) and [forgejo](https://forgejo.org) by modifying the ``gitea_fork`` variable. +| variable name | default value | description | +| ------------- | ------------- | ----------- | +| `gitea_fork` | `gitea` | optional choose to install forgejo instead of gitea by setting this value to `forgejo`. | + ### gitea update mechanism To determine which gitea version to install, you can choose between two variants. Either you define exactly which release you install. Or you use the option ``latest`` to always install the latest release from the [gitea releases](https://github.com/go-gitea/gitea/releases/latest). diff --git a/defaults/main.yml b/defaults/main.yml index cc25b72..ecd9e09 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,9 +1,13 @@ --- +# Choose between https://forgejo.org/ and https://gitea.io/ +gitea_fork: 'gitea' # 'gitea' and 'forgejo' are valid options + # gitea version # Use 'latest' to auto-update; upgrading past role version may lead to errors. gitea_version: 'latest' gitea_version_check: true gitea_gpg_key: '7C9E68152594688862D62AF62D9AE806EC1592E2' +gitea_forgejo_gpg_key: 'EB114F5E6C0DC2BCDD183550A4B61A2DC5923710' gitea_gpg_server: 'hkps://keys.openpgp.org' gitea_backup_on_upgrade: false gitea_backup_location: "{{ gitea_home }}/backups/" diff --git a/tasks/main.yml b/tasks/main.yml index 4c43859..d8d4339 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,6 +7,15 @@ ansible.builtin.package_facts: manager: auto +- name: Prepare gitea/forgejo variable import + block: + - name: Gather variables for gitea or forgejo + ansible.builtin.include_vars: "{{ lookup('first_found', gitea_fork_variables) }}" + rescue: + - name: Gitea/Forejo import info + ansible.builtin.fail: + msg: "Currently only {{ gitea_supported_forks }} are supported." + - name: Gather variables for each operating system ansible.builtin.include_vars: "{{ lookup('first_found', gitea_variables) }}" diff --git a/vars/fork_forgejo.yml b/vars/fork_forgejo.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/vars/fork_forgejo.yml @@ -0,0 +1 @@ +--- diff --git a/vars/fork_gitea.yml b/vars/fork_gitea.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/vars/fork_gitea.yml @@ -0,0 +1 @@ +--- diff --git a/vars/main.yml b/vars/main.yml index 10d7f52..f2f4b56 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -9,6 +9,13 @@ gitea_go_arch_map: gitea_arch: "{{ gitea_go_arch_map[ansible_architecture] | default(ansible_architecture) }}" gitea_filename: "gitea-{{ gitea_version_target }}.linux-{{ gitea_arch }}" +gitea_supported_forks: 'gitea and forgejo' + +gitea_fork_variables: + files: + - "fork_{{ gitea_fork | lower }}.yml" + paths: + - 'vars' gitea_variables: files: