correction backup restore
[lhc/ansible.git] / tasks / backup_nextcloud.yml
1 - name: Active le mode maintenance # noqa : command-instead-of-module
2 become_user: "{{ nextcloud_php_user }}"
3 become: true
4 ansible.builtin.command: './console maintenance:mode --on'
5 args:
6 chdir: "{{ nextcloud_webroot }}"
7
8 - name: Create a dump of the postgreSQL database # noqa : command-instead-of-module
9 become: true
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 }}"
12 args:
13 chdir: "{{ nextcloud_webroot }}"
14
15 - name: Copy nextcloud config file
16 become: true
17 ansible.builtin.copy:
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 }}"
23 mode: '640'
24
25 - name: Desactive le mode maintenance # noqa : command-instead-of-module
26 become_user: "{{ nextcloud_php_user }}"
27 become: true
28 ansible.builtin.command: './console maintenance:mode --off'
29 args:
30 chdir: "{{ nextcloud_webroot }}"