--- - name: create nextcloud restore dir ansible.builtin.file: path: "{{ nextcloud_tmp_path }}" state: directory mode: '0777' # - name: activate nextcloud maintenance mode # become_user: "{{ nextcloud_websrv_user }}" # become: true # command: './console maintenance:mode --on' # args: # chdir: "{{ nextcloud_webroot }}" # - name: "Compress directory {{ nextcloud_data_path }} into {{ nextcloud_tmp_path }}/data.tar.gz" # become_user: "{{ nextcloud_websrv_user }}" # become: true # community.general.archive: # path: "{{ nextcloud_data_path }}" # dest: "{{ nextcloud_tmp_path }}/data.tar.gz" # format: gz # force_archive: true # mode: 777 - name: Create a dump of the postgreSQL database become: true become_user: "{{ nextcloud_websrv_user }}" command: "pg_dump -f {{ nextcloud_tmp_path }}/dump.sql -F c -O -b {{ nextcloud_db_name }}" - name: Fetch nextcloud_data from atelier to ansible controller fetch: src: "{{ item }}" dest: "{{ nextcloud_tmp_path }}/" flat: yes loop: - "{{ nextcloud_tmp_path }}/dump.sql" - "{{ nextcloud_tmp_path }}/data.tgz" - "{{ nextcloud_webroot }}/config/config.php" # - name: deactivate nextcloud maintenance mode # become_user: "{{ nextcloud_websrv_user }}" # become: true # command: './console maintenance:mode --off' # args: # chdir: "{{ nextcloud_webroot }}"