Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 362ec8c85f | |||
| 9866c8e6a9 | |||
| 03e26e0598 |
@@ -2,5 +2,5 @@
|
||||
nextcloud_instances: []
|
||||
nextcloud_user: "cloud"
|
||||
nextcloud_path: "/var/www/nextcloud"
|
||||
php_binary: "php"
|
||||
php_arguments: ""
|
||||
php_binary_default: "php"
|
||||
php_arguments_default: ""
|
||||
@@ -4,8 +4,8 @@
|
||||
vars:
|
||||
nextcloud_user: "{{ nc_instance.nextcloud_user }}"
|
||||
nextcloud_path: "{{ nc_instance.nextcloud_path }}"
|
||||
php_binary: "{{ nc_instance.php_binary }}"
|
||||
php_arguments: "{{ nc_instance.php_arguments }}"
|
||||
php_binary: "{{ nc_instance.php_binary | default(php_binary_default) }}"
|
||||
php_arguments: "{{ nc_instance.php_arguments | default(php_arguments_default) }}"
|
||||
loop_control:
|
||||
loop_var: "nc_instance"
|
||||
loop: "{{ nextcloud_instances }}"
|
||||
loop: "{{ nextcloud_instances }}"
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
---
|
||||
- name: "Run Update-Check"
|
||||
- name: "{{ nextcloud_path }}: Run Update-Check"
|
||||
become: true
|
||||
become_user: "{{ nextcloud_user }}"
|
||||
shell:
|
||||
cmd: "{{ php_binary }} {{ php_arguments }} {{ nextcloud_path }}/occ update:check --no-interaction --no-warnings"
|
||||
register: nextcloud_update_check_output
|
||||
|
||||
- name: "Parse Update-Check Output"
|
||||
- name: "{{ nextcloud_path }}: Parse Update-Check Output"
|
||||
ansible.builtin.set_fact:
|
||||
nextcloud_update_needed: "{{ nextcloud_update_check_output.stdout | regex_search(update_regex) }}"
|
||||
vars:
|
||||
update_regex: 'Nextcloud [\d\.]+ is available'
|
||||
|
||||
- name: "Main Update block"
|
||||
- name: "{{ nextcloud_path }}: Main Update block"
|
||||
when: "nextcloud_update_needed"
|
||||
block:
|
||||
- name: "Run Update"
|
||||
- name: "{{ nextcloud_path }}: Entering Updater"
|
||||
include_tasks: "update.yml"
|
||||
when: nextcloud_update_needed
|
||||
|
||||
|
||||
- name: "Run Maintenance tasks (after update)"
|
||||
- name: "{{ nextcloud_path }}: Run Maintenance tasks (after update)"
|
||||
include_tasks: "occ_command.yml"
|
||||
vars:
|
||||
occ_command: "{{ item }}"
|
||||
@@ -28,7 +28,7 @@
|
||||
- "maintenance:repair --no-interaction"
|
||||
when: "nextcloud_update_needed"
|
||||
|
||||
- name: "Run Maintenance tasks"
|
||||
- name: "{{ nextcloud_path }}: Run Maintenance tasks"
|
||||
include_tasks: "occ_command.yml"
|
||||
vars:
|
||||
occ_command: "{{ item }}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: "Run OCC Command: {{ occ_command }}"
|
||||
- name: "{{ nextcloud_path }}: Run OCC Command: {{ occ_command }}"
|
||||
become: true
|
||||
become_user: "{{ nextcloud_user }}"
|
||||
shell:
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
---
|
||||
- name: "Run Updater"
|
||||
- name: "{{ nextcloud_path }}: Run Updater.phar"
|
||||
become: true
|
||||
become_user: "{{ nextcloud_user }}"
|
||||
shell:
|
||||
chdir: "{{ nextcloud_path }}/updater"
|
||||
cmd: "alias \"php={{ php_binary }} {{ php_arguments }}\"; php {{ nextcloud_path }}/updater/updater.phar --no-interaction"
|
||||
|
||||
- name: "Disable Maintenance-Mode"
|
||||
- name: "{{ nextcloud_path }}: Disable Maintenance-Mode"
|
||||
include_tasks: "occ_command.yml"
|
||||
vars:
|
||||
occ_command: "maintenance:mode --off"
|
||||
|
||||
- name: "Run Updater Part 2"
|
||||
- name: "{{ nextcloud_path }}: Run Updater Part 2"
|
||||
include_tasks: "occ_command.yml"
|
||||
vars:
|
||||
occ_command: "upgrade --no-interaction"
|
||||
|
||||
- name: "Disable Maintenance-Mode"
|
||||
- name: "{{ nextcloud_path }}: Disable Maintenance-Mode"
|
||||
include_tasks: "occ_command.yml"
|
||||
vars:
|
||||
occ_command: "maintenance:mode --off"
|
||||
Reference in New Issue
Block a user