Skip to content

Commit

Permalink
nextcloud: Move cache and updater directories out of data directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Aug 26, 2024
1 parent 3fd28f2 commit 05364da
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 4 additions & 0 deletions roles/nextcloud/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
value: \OC\Memcache\Redis
- name: memcache.locking
value: \OC\Memcache\Redis
- name: cache_path
value: /var/cache/nextcloud
- name: updatedirectory
value: /var/cache/nextcloud/.updater
- name: log_type
value: syslog
- name: log_type_audit
Expand Down
2 changes: 1 addition & 1 deletion roles/nextcloud/tasks/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
php_fpm_site: nextcloud
php_fpm_domain: "{{ nextcloud_domain }}"
php_fpm_temporary_file_system: /var:ro
php_fpm_bind_paths: /var/lib/nextcloud/data /var/run /var/www/nextcloud /home/nextcloud/.cache
php_fpm_bind_paths: /var/lib/nextcloud/data /var/run /var/www/nextcloud /home/nextcloud/.cache /var/cache/nextcloud
php_memory_limit: "{{ nextcloud_upload_max_size }}"
php_upload_max_filesize: "{{ nextcloud_upload_max_size }}"
php_opcache_interned_strings_buffer: 32
Expand Down
9 changes: 7 additions & 2 deletions roles/nextcloud/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,21 @@
state: absent
when: _tmp_dir.path is defined

- name: Ensure Nextcloud data directory is present
- name: Ensure Nextcloud directories are present
ansible.builtin.file:
path: /var/lib/nextcloud/data
path: "{{ item }}"
owner: nextcloud
group: nextcloud
mode: "0750"
setype: httpd_sys_rw_content_t
recurse: true
state: directory
tags: molecule-idempotence-notest # Fail with SELinux context
with_items:
- /var/cache/nextcloud
- /var/cache/nextcloud/.updater
- /var/lib/nextcloud/data
- /home/nextcloud/.cache

- name: Ensure Web server have write permissions on Nextcloud directories
ansible.builtin.file:
Expand Down
8 changes: 0 additions & 8 deletions roles/nextcloud/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
ansible.builtin.user:
name: nextcloud

- name: Ensure /home/nextcloud/.cache directory is present
ansible.builtin.file:
path: /home/nextcloud/.cache
state: directory
owner: nextcloud
group: nextcloud
mode: '0755'

- name: Ensure Nextcloud var directory is present
ansible.builtin.file:
path: /var/lib/nextcloud
Expand Down

0 comments on commit 05364da

Please sign in to comment.