--- - block: - name: nextcloud list config command: php occ config:list args: chdir: "{{nextcloud_directory}}" register: _nextcloud_config_cmd changed_when: false - name: nextcloud occ config:system:delete trusted_domains command: php occ config:system:delete trusted_domains args: chdir: "{{nextcloud_directory}}" when: _nextcloud_config.system.trusted_domains != nextcloud_server_names - name: nextcloud occ config:system:set trusted_domains command: php occ config:system:set trusted_domains {{ item.0 }} --value={{ item.1 }} args: chdir: "{{nextcloud_directory}}" with_indexed_items: "{{ nextcloud_server_names }}" when: _nextcloud_config.system.trusted_domains != nextcloud_server_names - name: nextcloud occ config:system:set overwrite.cli.url (fix bug in nextcloud 14) command: php occ config:system:set overwrite.cli.url --value="https://{{nextcloud_server_names|first}}/" args: chdir: "{{nextcloud_directory}}" when: nextcloud_version is version('14.0.0','ge') - name: nextcloud occ maintenance:update:htaccess command: php occ maintenance:update:htaccess args: chdir: "{{nextcloud_directory}}" - name: nextcloud occ background:cron command: php occ background:cron args: chdir: "{{nextcloud_directory}}" become: true become_user: www-data become_method: sudo