- name: Active le mode maintenance # noqa : command-instead-of-module become_user: "{{ nextcloud_php_user }}" become: true ansible.builtin.command: './console maintenance:mode --on' args: chdir: "{{ nextcloud_webroot }}" - name: Create a dump of the postgreSQL database # noqa : command-instead-of-module become: true become_user: "{{ nextcloud_php_user }}" ansible.builtin.command: "pg_dump -f /tmp/{{ nextcloud_db_name }}.pgc -F c -O -b {{ nextcloud_db_name }}" args: chdir: "{{ nextcloud_webroot }}" - name: Copy nextcloud config file become: true ansible.builtin.copy: src: "{{ nextcloud_webroot }}/config/config.php" dest: "{{ nextcloud_webroot }}/config/config.php.bak" remote_src: true # because the src is already on the remote host owner: "{{ nextcloud_php_user }}" group: "{{ nextcloud_websrv_user }}" mode: '640' - name: Desactive le mode maintenance # noqa : command-instead-of-module become_user: "{{ nextcloud_php_user }}" become: true ansible.builtin.command: './console maintenance:mode --off' args: chdir: "{{ nextcloud_webroot }}"