1 - name: Active le mode maintenance # noqa : command-instead-of-module
2 become_user: "{{ nextcloud_php_user }}"
4 ansible.builtin.command: './console maintenance:mode --on'
6 chdir: "{{ nextcloud_webroot }}"
8 - name: Create a dump of the postgreSQL database # noqa : command-instead-of-module
10 become_user: "{{ nextcloud_php_user }}"
11 ansible.builtin.command: "pg_dump -f /tmp/{{ nextcloud_db_name }}.pgc -F c -O -b {{ nextcloud_db_name }}"
13 chdir: "{{ nextcloud_webroot }}"
15 - name: Copy nextcloud config file
18 src: "{{ nextcloud_webroot }}/config/config.php"
19 dest: "{{ nextcloud_webroot }}/config/config.php.bak"
20 remote_src: true # because the src is already on the remote host
21 owner: "{{ nextcloud_php_user }}"
22 group: "{{ nextcloud_websrv_user }}"
25 - name: Desactive le mode maintenance # noqa : command-instead-of-module
26 become_user: "{{ nextcloud_php_user }}"
28 ansible.builtin.command: './console maintenance:mode --off'
30 chdir: "{{ nextcloud_webroot }}"