Adds tasks to gather and run open background jobs on demand (run with --tags run_background_jobs
)
This commit is contained in:
parent
23e504e481
commit
8f3f6dd3d5
1 changed files with 24 additions and 0 deletions
|
@ -231,6 +231,30 @@
|
||||||
- nextcloud_database_utils is defined
|
- nextcloud_database_utils is defined
|
||||||
- nextcloud_database_utils | length > 0
|
- nextcloud_database_utils | length > 0
|
||||||
|
|
||||||
|
- name: Run background jobs
|
||||||
|
tags: ['never', 'run_background_jobs']
|
||||||
|
block:
|
||||||
|
- name: Get list of background jobs
|
||||||
|
shell:
|
||||||
|
chdir: /home/{{ docker_user }}/nextcloud/
|
||||||
|
cmd: docker-compose exec -T -u www-data nextcloud-app /bin/sh -c './occ background-job:list --output=json'
|
||||||
|
register: background_jobs
|
||||||
|
|
||||||
|
- name: Output background jobs
|
||||||
|
debug:
|
||||||
|
msg: "{{ background_jobs.stdout }}"
|
||||||
|
|
||||||
|
- name: Run background jobs
|
||||||
|
shell:
|
||||||
|
chdir: /home/{{ docker_user }}/nextcloud/
|
||||||
|
cmd: docker-compose exec -T -u www-data nextcloud-app /bin/sh -c './occ background-job:execute --force-execute {{ item.id }}'
|
||||||
|
loop: "{{ background_jobs.stdout }}"
|
||||||
|
register: background_jobs_execution_result
|
||||||
|
|
||||||
|
- name: Output background jobs execution result
|
||||||
|
debug:
|
||||||
|
msg: "{{ background_jobs_execution_result }}"
|
||||||
|
|
||||||
- name: "docker-compose: Disable maintenance mode using occ"
|
- name: "docker-compose: Disable maintenance mode using occ"
|
||||||
shell:
|
shell:
|
||||||
chdir: /home/{{ docker_user }}/nextcloud/
|
chdir: /home/{{ docker_user }}/nextcloud/
|
||||||
|
|
Loading…
Add table
Reference in a new issue