From: rominique Date: Mon, 1 Jul 2024 17:34:04 +0000 (+0200) Subject: ajout d'un garde fou pour la creation du dossier app common X-Git-Url: http://git.cyclocoop.org/%22%22.url_de_base%28%29.%22/%40%20%27info_date_publication_anterieure%27%20=%3E%20%27Previously%20published%20on:%27%2C%20%27info_date_referencement%27%20=%3E%20%27THIS%20SITE%20REFERENCED%20ON:%27%2C%20%27info_derniere_etape%27%20=%3E%20%27Done%21%27%2C-%27info_derniers_articles_publies%27%20=%3E%20%27Your%20most%20recently%20published%20articles%27%2C-%27info_desactiver_messagerie_personnelle%27%20=%3E%20%27You%20can%20enable%20or%20disable%20your%20personal%20messaging%20on%20this%20site.%27%2C%20%27info_descriptif%27%20=%3E%20%27Description:%27%2C%20%27info_desinstaller_plugin%27%20=%3E%20%27%20deactivates%20the%20plugin%20and%20deletes%20the%20data%27%2C%20%27info_discussion_cours%27%20=%3E%20%27Current%20discussions%27%2C%40%40%20-332%2C7%20%20284%2C6%20%40%40%20Do%20not%20submit%20this%20import%20request.%3Cp%3EFor%20more%20information%2C%20please%20see%20%3Ca%20href=?a=commitdiff_plain;h=5d2aeccf18b1c772a027ab9c26c576ab2d788a62;p=lhc%2Fansible.git ajout d'un garde fou pour la creation du dossier app common suppression de variables inutiles --- diff --git a/creation_nouveau_site.yml b/creation_nouveau_site.yml index b9029e0..ed292dd 100644 --- a/creation_nouveau_site.yml +++ b/creation_nouveau_site.yml @@ -10,8 +10,6 @@ vars: # config_nginx: true à l'avenir on pourrait demander à l'utilisateur de choisir si il veut configurer nginx - # nouvelle_version: 27.1.7 # nextcloud - # ancienne_version: 27.1.6 # nextcloud vars_prompt: diff --git a/host_vars/ligatures.yml b/host_vars/ligatures.yml index 77a50a5..23b2bef 100644 --- a/host_vars/ligatures.yml +++ b/host_vars/ligatures.yml @@ -4,10 +4,8 @@ nextcloud_sources_files_path: "/home/sites/data/nextcloud/sources" nextcloud_common_files_path: "/home/sites/data/nextcloud/common" nextcloud_webroot: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/nuage" nextcloud_source: "{{ nextcloud_sources_files_path }}/nextcloud-{{ nouvelle_version }}" -nextcloud_old_source: "{{ nextcloud_sources_files_path }}/nextcloud-{{ ancienne_version }}" nextcloud_symbolic_source: "../../../nextcloud/sources/nextcloud-{{ nouvelle_version }}" nextcloud_common: "{{ nextcloud_common_files_path }}/nextcloud-{{ nouvelle_version }}" -nextcloud_old_common: "{{ nextcloud_common_files_path }}/nextcloud-{{ ancienne_version }}" nextcloud_symbolic_common: "../../../nextcloud/common.config.php" php_fpm_service: php{{ php_version}}-fpm php_version: '8.2' diff --git a/tasks/verif_installation_nextcloud.yml b/tasks/verif_installation_nextcloud.yml index 508c5fd..b649e2e 100644 --- a/tasks/verif_installation_nextcloud.yml +++ b/tasks/verif_installation_nextcloud.yml @@ -17,6 +17,13 @@ ansible_become: true become_user: nextcloud +# on utilise une version uniquement si test-nuage a préalablement été mis à jour dans cette version + +- name: fail si test-nuage n'a pas été mis à jour avec cette version + ansible.builtin.fail: + msg: 'il faut déjà mettre à jour test-nuage avec cette version' + when: not new_nextcloud_common.stat.exists and test_nuage is not defined + - name: Create new app common folder from old version one become_user: nextcloud become: true @@ -25,4 +32,4 @@ dest: "{{ nextcloud_common_files_path }}/nextcloud-{{ nouvelle_version }}" remote_src: true # because the copy is from remote host to remote host mode: '754' # or 'u=rwx,g=rx,o=r' - when: not new_nextcloud_common.stat.exists + when: not new_nextcloud_common.stat.exists and test_nuage is defined diff --git a/update_nuage_instance.yml b/update_nuage_instance.yml index fa70f08..5c0aa56 100644 --- a/update_nuage_instance.yml +++ b/update_nuage_instance.yml @@ -69,6 +69,13 @@ ansible_become: true become_user: nextcloud +# on met à jour une instance uniquement si test-nuage a préalablement été mis à jour dans cette version + + - name: fail si test-nuage n'a pas été mis à jour avec cette version + ansible.builtin.fail: + msg: 'il faut déjà mettre à jour test-nuage avec cette version' + when: not new_nextcloud_common.stat.exists and test_nuage is not defined + - name: Création du dossier common de la nouvelle version en utilisant les apps de l'instance test-nuage become: true ansible.builtin.copy: @@ -78,7 +85,7 @@ mode: '754' # or 'u=rwx,g=rx,o=r' owner: nextcloud group: nextcloud - when: not new_nextcloud_common.stat.exists + when: not new_nextcloud_common.stat.exists and test_nuage is defined - name: Include backup tasks ansible.builtin.include_tasks: tasks/backup_nextcloud.yml