--- # TODO: fix idempotence - name: set up permission for external storage command: docker exec -u root nextcloud.service bash -c "chown root:www-data /srv/external && chmod 02775 /srv/external" changed_when: false ## TODO: this is idempotent but flagging change would be nice - name: set up permission for external storage command: docker exec -u www-data nextcloud.service /var/www/html/occ app:enable files_external changed_when: false - name: check if elevate group exists in nextcloud (1/2) command: docker exec -u www-data nextcloud.service /var/www/html/occ group:list -n --output=json register: nextcloud_group_list changed_when: false - name: check if elevate group exists in nextcloud (2/2) set_fact: nextcloud_group_list: "{{ nextcloud_group_list.stdout | from_json }}" - name: create group elevate group in nextcloud command: docker exec -u www-data nextcloud.service /var/www/html/occ group:add -n elevate when: '"elevate" not in nextcloud_group_list' - name: check if external storage is configured in nextcloud (1/2) command: docker exec -u www-data nextcloud.service /var/www/html/occ files_external:list -n --output=json register: nextcloud_files_external_list changed_when: false - name: check if external storage is configured in nextcloud (2/2) set_fact: nextcloud_files_external_list: "{{ nextcloud_files_external_list.stdout | from_json }}" - debug: var: nextcloud_files_external_list - name: configure external storage in nextcloud command: docker exec -u www-data nextcloud.service /var/www/html/occ files_external:create -n --output=json --config="datadir=/srv/external" Fileserver local null::null when: not (nextcloud_files_external_list | nextcloud_mountpoint_exists('/Fileserver')) ## TODO: this is idempotent but flagging change would be nice - name: set up permission for external storage command: docker exec -u www-data nextcloud.service /var/www/html/occ files_external:applicable -n --output=json 1 --add-group=elevate changed_when: false ### add this until tests have been done ## 'overwriteprotocol' => 'http', -> /srv/nextcloud/config/nextcloud/config.php #