aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2024-06-02 12:04:50 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2024-06-02 12:04:50 +0200
commit0fa3841f5f335e97d6b09a9aa6d7c6ccdce7fbd4 (patch)
tree5357672cb288505a83ec1ae48480561f9e1a8890
parent7cd054de6bec2b4b097639e5e69b482236a37113 (diff)
downloadansible_collection-0fa3841f5f335e97d6b09a9aa6d7c6ccdce7fbd4.tar.gz
gitea allow forgejo
-rw-r--r--galaxy.yml2
-rw-r--r--roles/gitea/defaults/main.yml3
-rw-r--r--roles/gitea/tasks/main.yml9
-rw-r--r--roles/gitea/tasks/update.yml14
4 files changed, 26 insertions, 2 deletions
diff --git a/galaxy.yml b/galaxy.yml
index 8870883..6de9c3b 100644
--- a/galaxy.yml
+++ b/galaxy.yml
@@ -1,6 +1,6 @@
namespace: kompetenzbolzen
name: stuff
-version: 0.25.1
+version: 0.26.0
readme: README.md
authors:
- Jonas Gunz <himself@jonasgunz.de>
diff --git a/roles/gitea/defaults/main.yml b/roles/gitea/defaults/main.yml
index acb6f80..e618d50 100644
--- a/roles/gitea/defaults/main.yml
+++ b/roles/gitea/defaults/main.yml
@@ -1,4 +1,5 @@
---
+gitea_use_forgejo: false
gitea:
ldap:
enable: true
@@ -59,4 +60,4 @@ gitea:
ALLOWED_HOST_LIST: ''
oauth2:
ENABLE: false
- JWT_SECRET: '{{ jwt_sec.content }}'
+ JWT_SECRET: '{{ jwt_sec.content | b64decode }}'
diff --git a/roles/gitea/tasks/main.yml b/roles/gitea/tasks/main.yml
index 77391ec..0d49cf3 100644
--- a/roles/gitea/tasks/main.yml
+++ b/roles/gitea/tasks/main.yml
@@ -64,6 +64,15 @@
method: GET
return_content: yes
register: gitea_sha256_raw
+ when: not gitea_use_forgejo
+
+- name: pull forgejo sha256sum
+ uri:
+ url: 'https://codeberg.org/forgejo/forgejo/releases/download/v{{ gitea.version.ver }}/forgejo-{{ gitea.version.ver }}-linux-amd64.sha256'
+ method: GET
+ return_content: yes
+ register: gitea_sha256_raw
+ when: gitea_use_forgejo
- name: set sha256sum
set_fact:
diff --git a/roles/gitea/tasks/update.yml b/roles/gitea/tasks/update.yml
index 46538ae..ae6fe1f 100644
--- a/roles/gitea/tasks/update.yml
+++ b/roles/gitea/tasks/update.yml
@@ -21,3 +21,17 @@
become: yes
notify:
- Handle systemd
+ when: not gitea_use_forgejo
+
+- name: Download forgejo
+ get_url:
+ url: 'https://codeberg.org/forgejo/forgejo/releases/download/v{{ gitea.version.ver }}/forgejo-{{ gitea.version.ver }}-linux-amd64'
+ checksum: 'sha256:{{ gitea_sha256 }}'
+ dest: /usr/local/bin/gitea
+ owner: root
+ group: root
+ mode: '755'
+ become: yes
+ notify:
+ - Handle systemd
+ when: gitea_use_forgejo