-- name: Stop webserver service
+- name: Active le mode maintenance # noqa : command-instead-of-module
+ become_user: "{{ nextcloud_php_user }}"
become: true
- ansible.builtin.service:
- name: "{{ nextcloud_websrv }}"
- state: stopped
+ ansible.builtin.command: './console maintenance:mode --on'
+ args:
+ chdir: "{{ nextcloud_webroot }}"
- name: Update nextcloud root dir symbolic link
become: true
state: link
follow: false
-- name: Start webserver service
+- name: Desactive le mode maintenance # noqa : command-instead-of-module
+ become_user: "{{ nextcloud_php_user }}"
become: true
- ansible.builtin.service:
- name: "{{ nextcloud_websrv }}"
- state: started
+ ansible.builtin.command: './console maintenance:mode --off'
+ args:
+ chdir: "{{ nextcloud_webroot }}"
- name: Run nextcloud upgrade script # noqa : command-instead-of-module
- become_user: "{{ nextcloud_websrv_user }}"
+ become_user: "{{ nextcloud_php_user }}"
become: true
ansible.builtin.command: ./console upgrade
args:
- name: Bloc de tâches contrôlant la fin de la maintenance de mise à jour
block:
- name: Wait for nextcloud maintenance mode to become false # noqa : command-instead-of-module
- become_user: "{{ nextcloud_websrv_user }}"
+ become_user: "{{ nextcloud_php_user }}"
become: true
ansible.builtin.command: ./console status
args:
delay: 20
rescue:
- name: Deactivate maintenance mode manually # noqa : command-instead-of-module
- become_user: "{{ nextcloud_websrv_user }}"
+ become_user: "{{ nextcloud_php_user }}"
become: true
ansible.builtin.command: ./console maintenance:mode --off
args: