diff options
Diffstat (limited to 'roles')
-rw-r--r-- | roles/apps/nextcloud/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/apps/nextcloud/tasks/main.yml | 35 | ||||
-rw-r--r-- | roles/apps/nextcloud/templates/pod-spec-with-mariadb.yml.j2 | 17 |
3 files changed, 47 insertions, 8 deletions
diff --git a/roles/apps/nextcloud/defaults/main.yml b/roles/apps/nextcloud/defaults/main.yml index db186b53..f194a6f9 100644 --- a/roles/apps/nextcloud/defaults/main.yml +++ b/roles/apps/nextcloud/defaults/main.yml @@ -5,6 +5,9 @@ nextcloud_app_gid: "950" nextcloud_db_uid: "951" nextcloud_db_gid: "951" +nextcloud_redis_uid: "952" +nextcloud_redis_gid: "952" + # nextcloud_base_path: /srv/nextcloud # nextcloud_zfs: diff --git a/roles/apps/nextcloud/tasks/main.yml b/roles/apps/nextcloud/tasks/main.yml index c9a9061c..12b15abc 100644 --- a/roles/apps/nextcloud/tasks/main.yml +++ b/roles/apps/nextcloud/tasks/main.yml @@ -65,7 +65,7 @@ password: "!" - name: create nextcloud database subdirectory - loop: "{{ nextcloud_instances | dict2items}}" + loop: "{{ nextcloud_instances | dict2items }}" loop_control: label: "{{ item.key }} ({{ item.value.database.type }})" file: @@ -75,6 +75,27 @@ state: directory +- name: add group for nextcloud redis + group: + name: nc-redis + gid: "{{ nextcloud_redis_gid }}" + +- name: add user for nextcloud redis + user: + name: nc-redis + uid: "{{ nextcloud_redis_uid }}" + group: nc-redis + password: "!" + +- name: create nextcloud database subdirectory + loop: "{{ nextcloud_instances | list }}" + file: + path: "{{ nextcloud_base_path }}/{{ item }}/redis" + owner: "{{ nextcloud_redis_uid }}" + group: "{{ nextcloud_redis_gid }}" + state: directory + + - name: create auxiliary config directory loop: "{{ nextcloud_instances | list }}" file: @@ -204,12 +225,10 @@ ** Go to https://{{ item.value.hostnames[0] }} and finalize the ** installation. After that run the following commands: ** - ** $ nextcloud-occ {{ item.key }} app:disable richdocumentscode - ** $ nextcloud-occ {{ item.key }} app:remove richdocumentscode - ** - ** Also please add the following option to the file - ** "{{ nextcloud_base_path }}/{{ item.key }}/nextcloud/config/config.php" - ** - ** 'default_phone_region' => 'at', + ** $ nextcloud-occ {{ item.key }} config:system:set default_phone_region --value='at' + ** $ nextcloud-occ {{ item.key }} config:system:set redis host --value '127.0.0.1' + ** $ nextcloud-occ {{ item.key }} config:system:set redis port --type integer --value 6379 + ** $ nextcloud-occ {{ item.key }} config:system:set redis timeout --type float --value 0.0 + ** $ nextcloud-occ {{ item.key }} config:system:set redis password ** **************************************** diff --git a/roles/apps/nextcloud/templates/pod-spec-with-mariadb.yml.j2 b/roles/apps/nextcloud/templates/pod-spec-with-mariadb.yml.j2 index 725f84d9..983f363a 100644 --- a/roles/apps/nextcloud/templates/pod-spec-with-mariadb.yml.j2 +++ b/roles/apps/nextcloud/templates/pod-spec-with-mariadb.yml.j2 @@ -40,6 +40,19 @@ containers: - containerPort: 8080 hostPort: {{ item.value.port }} hostIP: 127.0.0.1 +- name: redis + image: "redis:{{ item.value.redis.version }}" + args: + - --bind 127.0.0.1 + securityContext: + runAsUser: {{ nextcloud_redis_uid }} + runAsGroup: {{ nextcloud_redis_gid }} + resources: + limits: + memory: "512Mi" + volumeMounts: + - name: redis + mountPath: /data - name: database image: "mariadb:{{ item.value.database.version }}" args: @@ -75,6 +88,10 @@ volumes: hostPath: path: "{{ nextcloud_base_path }}/{{ item.key }}/nextcloud" type: Directory +- name: redis + hostPath: + path: "{{ nextcloud_base_path }}/{{ item.key }}/redis" + type: Directory - name: database hostPath: path: "{{ nextcloud_base_path }}/{{ item.key }}/{{ item.value.database.type }}" |