nextcloud(role): remove async → use batched shell; more robust changed_when/failed_when; fix quoting; refactor plugin routines; clean up vars

• 02_add_missing_indices.yml: switched to shell (+ansible_command_timeout), removed async/poll.

• 04_system_config.yml: batch OCC calls (set -euo pipefail, /bin/bash), safer quoting, change detection via ' set to '.

• 05_plugin.yml: disable task with stricter failed_when/changed_when (combine stdout+stderr).

• 06_plugin_routines.yml: disable incompatible plugins in a single batch; no async_status; robust changed_when.

• 07_plugin_enable_and_configure.yml: batch config:app:set, safe quoting, clear changed_when/failed_when.

• config/main.yml & vars/main.yml: removed performance.async.wait_for and nextcloud_wait_for_async_enabled.
This commit is contained in:
2025-08-13 18:15:50 +02:00
parent 567b1365c0
commit e2014b9b59
7 changed files with 60 additions and 115 deletions

View File

@@ -2,33 +2,18 @@
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)
- name: "Apply Nextcloud system configs (batched shell)"
ansible.builtin.shell: |
set -euo pipefail
{% for item in nextcloud_system_config %}
{{ nextcloud_docker_exec_occ }} \
config:system:set {{ item.parameter }}{% if item.type is defined %} --type {{ item.type }}{% endif %} \
--value '{{ (item.value | string) | regex_replace("'", "'" ~ '"' ~ "'" ~ '"' ~ "'") }}'
{% endfor %}
args:
executable: /bin/bash
register: syscfg_shell
changed_when: >
(syscfg_wait.stdout is defined) and
("Value not changed" not in syscfg_wait.stdout)
when:
- nextcloud_wait_for_async_enabled | bool
( ((syscfg_shell.stdout | default('')) ~ (syscfg_shell.stderr | default('')))
is search(' set to ') )
failed_when: syscfg_shell.rc != 0