diff --git a/playbooks/gitea-rename-tasks.yaml b/playbooks/gitea-rename-tasks.yaml index 88b6e12fdd..85a6e1542a 100644 --- a/playbooks/gitea-rename-tasks.yaml +++ b/playbooks/gitea-rename-tasks.yaml @@ -8,6 +8,19 @@ neworg: "{{ repo.new.split('/')[0] }}" oldproj: "{{ repo.old.split('/')[1] }}" newproj: "{{ repo.new.split('/')[1] }}" +- name: Get Gitea org list + # We assume that all the orgs we are interested in are owned by root + uri: + url: "{{ gitea_url }}/api/v1/user/orgs" + user: root + password: "{{ gitea_root_password }}" + force_basic_auth: true + validate_certs: false + status_code: 200 + register: gitea_org_list +- name: Parse Gitea org list + set_fact: + gitea_orgs: "{{ gitea_org_list.json | map(attribute='username') | list }}" - name: "Make new gitea org" include_tasks: roles/gitea-git-repos/tasks/setup-org.yaml vars: