Kevin Veen-Birkenbach 567b1365c0
Nextcloud: async overhaul & task refactor (conditional wait, faster polling)
• Add config.performance.async.wait_for and expose as nextcloud_wait_for_async_enabled to toggle waiting for async jobs.

• Split system/admin/index maintenance into separate tasks: 02_add_missing_indices.yml, 03_admin.yml, 04_system_config.yml.

• Refactor plugin flow: rename 02_plugin→05_plugin, 03_plugin_routines→06_plugin_routines, 04_plugin_enable_and_configure→07_plugin_enable_and_configure; remove old 03_plugin_routines and 05_system.

• Harden async handling: filter async_status loops by ansible_job_id; conditionally wait only when nextcloud_wait_for_async_enabled; reduce delay to 1s.

• Reorder main.yml to run system steps before plugin setup; keep handlers flush earlier.

• env.j2: simplify get_app_conf lookups (drop extra True flag).

• vars/main.yml: add nextcloud_host_nginx_path and nextcloud_wait_for_async_enabled.

https://chatgpt.com/share/689c9d4a-1748-800f-b490-06a5a48dd831
2025-08-13 16:13:00 +02:00

35 lines
1.0 KiB
YAML

- name: Load System Nextcloud configuration variables
include_vars:
file: system.yml
- name: "Launch async: apply Nextcloud system configs"
ansible.builtin.command: >
{{ nextcloud_docker_exec_occ }}
config:system:set {{ item.parameter }}
{% if item.type is defined %} --type {{ item.type }}{% endif %}
--value {{ item.value }}
loop: "{{ nextcloud_system_config }}"
loop_control:
label: "{{ item.parameter }}"
async: 300
poll: 0
register: syscfg_jobs
- name: "Wait for system config jobs"
ansible.builtin.async_status:
jid: "{{ item.ansible_job_id }}"
loop: "{{ syscfg_jobs.results | default([]) }}"
loop_control:
label: "{{ item._ansible_item_label | default(item.item.parameter) }}"
register: syscfg_wait
until: syscfg_wait.finished
retries: 100
delay: 1
failed_when: >
(syscfg_wait.rc is defined and syscfg_wait.rc|int != 0)
changed_when: >
(syscfg_wait.stdout is defined) and
("Value not changed" not in syscfg_wait.stdout)
when:
- nextcloud_wait_for_async_enabled | bool