corrections du scenario restore
authorrominique <romain.legoff@heureux-cyclage.org>
Thu, 10 Oct 2024 14:06:24 +0000 (16:06 +0200)
committerrominique <romain.legoff@heureux-cyclage.org>
Thu, 10 Oct 2024 14:06:24 +0000 (16:06 +0200)
quand le bdd est utilisé, on force le drop db
correction du lien dossier common apps
correction du path vers le backup de la bdd
on ajoute des cmd de maintence NC

tasks/restore_nextcloud.yml

index 95e356d..e2b32d4 100644 (file)
@@ -18,7 +18,7 @@
 - name: Update nextcloud common app dir symbolic link
   become: true
   ansible.builtin.file:
-    src: "../../../nextcloud/sources/nextcloud-{{ ancienne_version }}"
+    src: "../../../nextcloud/common/nextcloud-{{ ancienne_version }}"
     dest: "{{ nextcloud_webroot }}/common"
     owner: nextcloud
     group: nextcloud
@@ -32,8 +32,9 @@
     name: "{{ nextcloud_db_name }}"
     state: "{{ item }}"
     owner: "{{ nextcloud_php_user }}"
-    target: "/tmp/{{ nextcloud_db_name }}.pgc"
+    target: "{{ nextcloud_webroot }}/data/{{ nextcloud_db_name }}.pgc"
     target_opts: "-F c"
+    force: yes
   loop:
     - absent
     - present
   args:
     chdir: "{{ nextcloud_webroot }}"
 
-- name: Run nextcloud upgrade script # noqa : command-instead-of-module
+- name: Lancement de commande de maintenance  # noqa : command-instead-of-module
   become_user: "{{ nextcloud_php_user }}"
   become: true
-  ansible.builtin.command: ./console upgrade
+  ansible.builtin.command: "./console {{ command }}"
   args:
     chdir: "{{ nextcloud_webroot }}"
+  loop:
+    - upgrade
+    - db:add-missing-columns
+    - db:add-missing-indices
+    - db:add-missing-primary-keys
+  loop_control:
+    loop_var: command
   register: nc_upgrade_result
 
 - name: Obtenir la version actuelle # noqa : command-instead-of-module