1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00

Create better error message for forgejo releases

+ Incremented simple version check
+ Added better error messages for chosing the wrong forgejo version

SOLVE https://github.com/roles-ansible/ansible_role_gitea/issues/106
This commit is contained in:
L3D 2023-05-10 00:08:43 +02:00
parent 643d9c32f3
commit 446d20c23d
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
2 changed files with 14 additions and 8 deletions

View file

@ -35,18 +35,24 @@
gitea_version_target: "{{ gitea_remote_version }}"
when: not ansible_check_mode
- name: "Set gitea version target {{ gitea_version }}"
- name: "Set forgejo version target {{ gitea_version }}"
ansible.builtin.set_fact:
gitea_version_target: "{{ gitea_version }}"
when: gitea_version != "latest"
- name: "Get specific forgejo release metadata"
- name: "Download forgejo version {{ gitea_version_target }}"
when: not ansible_check_mode
block:
- name: "Get specific forgejo release metadata"
ansible.builtin.uri:
url: 'https://codeberg.org/api/v1/repos/forgejo/forgejo/releases/tags/v{{ gitea_version_target }}'
return_content: true
register: gitea_forgejo_remote_tags_metadata
become: false
when: not ansible_check_mode
rescue:
- name: "Error Downloading https://codeberg.org/api/v1/repos/forgejo/forgejo/releases/tags/v{{ gitea_version_target }}"
ansible.builtin.fail:
msg: "We did not find the forgejo version you specified. Are you sure that '{{ gitea_version_target }}' is a valid forgejo version?"
- name: "Generate forgejo download url"
ansible.builtin.set_fact:

View file

@ -62,5 +62,5 @@ transfer_custom_footer:
- 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/extra_links_footer.tmpl'
playbook_version_number: 45 # should be int
playbook_version_number: 46 # should be int
playbook_version_path: 'do1jlr.gitea.version'