summaryrefslogtreecommitdiff
path: root/roles/apps/nextcloud/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-10-10 20:56:49 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-10-10 20:56:49 +0200
commit3359f912f005168e0d624b42540c231c5c538c2d (patch)
tree8e71ffa72cda20d4140198cd4a8108fc09b8ede1 /roles/apps/nextcloud/templates
parentno more flush-handlers for apt-repos (diff)
nextcloud: add app user to custom images
Diffstat (limited to 'roles/apps/nextcloud/templates')
-rwxr-xr-xroles/apps/nextcloud/templates/nextcloud-upgrade.j29
-rw-r--r--roles/apps/nextcloud/templates/pod-spec-with-mariadb.yml.j23
2 files changed, 11 insertions, 1 deletions
diff --git a/roles/apps/nextcloud/templates/nextcloud-upgrade.j2 b/roles/apps/nextcloud/templates/nextcloud-upgrade.j2
index 27bc6222..13178f0f 100755
--- a/roles/apps/nextcloud/templates/nextcloud-upgrade.j2
+++ b/roles/apps/nextcloud/templates/nextcloud-upgrade.j2
@@ -38,6 +38,15 @@ else
crictl pull "docker.io/library/nextcloud:$VERSION"
echo ""
fi
+{% if nextcloud_zfs is defined %}
+
+echo "*** creating ZFS snapshot"
+echo ""
+
+IMAGE_NAME_ESCAPED=${IMAGE_NAME/\//\\/}
+CURRENT_VERSION=$(cat "$K8S_MANIFEST_FILE" | awk '/image: "'"$IMAGE_NAME_ESCAPED"':.*"/ { print($2) }' | tr -d '"' | cut -d ':' -f 2)
+zfs snapshot "{{ nextcloud_zfs.pool }}/{{ nextcloud_zfs.name }}/$INST_NAME@upgrade_$CURRENT_VERSION-to-$VERSION""_$(date '+%Y-%m-%m_%H:%M:%S')"
+{% endif %}
echo "*** Patching manifest file"
echo ""
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 b587cad3..6100a2ab 100644
--- a/roles/apps/nextcloud/templates/pod-spec-with-mariadb.yml.j2
+++ b/roles/apps/nextcloud/templates/pod-spec-with-mariadb.yml.j2
@@ -2,7 +2,8 @@ securityContext:
allowPrivilegeEscalation: false
containers:
- name: nextcloud
- image: "nextcloud{% if 'custom_image' in item.value %}/{{ item.key }}{% endif %}:{{ item.value.version }}"
+{# image: "nextcloud{% if 'custom_image' in item.value %}/{{ item.key }}{% endif %}:{{ item.value.version }}" #}
+ image: "nextcloud/{{ item.key }}:{{ item.value.version }}"
securityContext:
runAsUser: {{ nextcloud_app_uid }}
runAsGroup: {{ nextcloud_app_gid }}