Refactor other modules tasks

This commit is contained in:
Tobias Reisinger 2026-11-13 16:15:34 +01:00
commit 1e684d3631
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE

View file

@ -55,17 +55,33 @@
notify: Restart service {{ service_name }}
when: service_name == role_name # Only use on the "main" instance
# You must provide this files yourself.
- name: Get other modules from nextcloud share
ansible.builtin.uri:
url: "{{ phpvms_other_modules }}"
method: PROPFIND
return_content: true
status_code: [200, 207]
register: phpvms_other_modules_response
- name: Transform response into list
ansible.builtin.set_fact:
phpvms_other_modules_host: "{{ phpvms_other_modules | urlsplit('hostname') }}"
phpvms_other_modules_list: "{{ phpvms_other_modules_xml['d:multistatus']['d:response'] | map(attribute='d:href') }}"
delegate_to: localhost
vars:
phpvms_other_modules_xml: "{{ phpvms_other_modules_response.content | ansible.utils.from_xml }}"
- name: Load other modules
ansible.builtin.unarchive:
src: "{{ item }}"
src: "https://{{ phpvms_other_modules_host }}{{ item }}"
dest: "{{ (service_path, 'modules') | path_join }}"
owner: "{{ phpvms_uid }}"
group: "{{ phpvms_gid }}"
remote_src: "{{ item.startswith('https://') }}"
remote_src: true
become: true
notify: Restart service {{ service_name }}
loop: "{{ phpvms_other_modules | default([]) }}"
loop: "{{ phpvms_other_modules_list }}"
when: "item.endswith('.zip')"
- name: Load DisposableBasic
ansible.builtin.unarchive: