From 718821bee1d6c40adef93d364a75ee24373237c6 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sat, 13 Oct 2018 01:31:32 +0000 Subject: [PATCH] fix app updates --- defaults/main.yml | 3 +-- tasks/main.yml | 1 - tasks/upgrade.yml | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 270aa4d..1e8a322 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -10,8 +10,7 @@ nextcloud_backup_directory: "{{nextcloud_lib_directory}}/backup" nextcloud_log_directory: /var/log/nextcloud -#nextcloud_version: "{{_nextcloud_latest_version}}" -nextcloud_version: 14.0.3 +nextcloud_version: "{{_nextcloud_latest_version}}" nextcloud_apps: - contacts diff --git a/tasks/main.yml b/tasks/main.yml index 91c59c6..992a382 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,7 +44,6 @@ #- import_tasks: check.yaml - - import_tasks: certificate.yml - import_tasks: apache2.yml diff --git a/tasks/upgrade.yml b/tasks/upgrade.yml index ea17f57..b67980a 100644 --- a/tasks/upgrade.yml +++ b/tasks/upgrade.yml @@ -8,6 +8,23 @@ owner: www-data group: www-data +- name: get old default apps + command: ls "{{nextcloud_archive_directory}}/{{nextcloud_version}}/nextcloud/apps" + register: _nextcloud_old_default_apps_ls + changed_when: false + +- name: get old actual apps + command: ls "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/nextcloud/apps" + register: _nextcloud_old_actual_apps_ls + changed_when: false + +- name: copy old installed apps + synchronize: + src: "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/nextcloud/apps/{{item}}/" + dest: "{{nextcloud_directory}}/apps/{{item}}" + with_items: "{{_nextcloud_old_actual_apps_ls.stdout_lines|difference(_nextcloud_old_default_apps_ls.stdout_lines)}}" + delegate_to: "{{inventory_hostname}}" + - name: upgrade nextcloud command: php occ upgrade args: