--- - name: backup directory file: path: "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}" state: directory - name: backup old nextcloud directory command: mv "{{nextcloud_directory}}/" "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/nextcloud" - name: dump mysql database shell: mysqldump "{{nextcloud_database_name}}" -h "{{nextcloud_database_host}}" -u "{{nextcloud_database_user}}" -p > "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/database.mysql" args: stdin: "{{nextcloud_database_pass}}"