- name: Vérif si la source nextcloud est téléchargée become: true ansible.builtin.stat: path: "{{ nextcloud_source }}" register: new_nextcloud_source - name: Vérif si le dossier common app est créé become: true ansible.builtin.stat: path: "{{ nextcloud_common }}" register: new_nextcloud_common - name: Include download_nextcloud_source tasks ansible.builtin.include_tasks: tasks/download_nextcloud_source.yml when: not new_nextcloud_source.stat.exists vars: ansible_become: true become_user: nextcloud - name: Create new app common folder from old version one become_user: nextcloud become: true ansible.builtin.copy: src: "{{ nextcloud_common_files_path }}/nextcloud-{{ ancienne_version }}/" 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