Skip to content

Commit

Permalink
stable: allow changing postgres version
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed Dec 6, 2024
1 parent 5d4c17f commit 0202622
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ix-dev/stable/home-assistant/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ sources:
- https://github.com/truenas/charts/tree/master/charts/home-assistant
title: Home Assistant
train: stable
version: 1.3.5
version: 1.4.0
5 changes: 4 additions & 1 deletion ix-dev/stable/home-assistant/ix_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ images:
image:
repository: homeassistant/home-assistant
tag: "2024.12.0"
postgres_image:
postgres_13_image:
repository: postgres
tag: "13.18"
postgres_17_image:
repository: postgres
tag: "17.2"
yq_image:
repository: mikefarah/yq
tag: "4.44.5"
Expand Down
16 changes: 16 additions & 0 deletions ix-dev/stable/home-assistant/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ questions:
schema:
type: dict
attrs:
- variable: postgres_image_selector
label: Postgres Image (CAUTION)
description: |
If you are changing this after the postgres directory has been initialized,</br>
STOP! and make sure you have a backup of your data.</br>
Changing this will trigger an one way database upgrade.</br>
If something goes wrong, you will have to restore from backup.
schema:
type: string
default: postgres_13_image
required: true
enum:
- value: postgres_13_image
description: Postgres 13
- value: postgres_17_image
description: Postgres 17
- variable: db_password
label: Database Password
description: The password for Home Assistant.
Expand Down
7 changes: 6 additions & 1 deletion ix-dev/stable/home-assistant/templates/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
"database": values.home_assistant.db_name,
"volume": values.storage.postgres_data,
} %}
{% set postgres = tpl.deps.postgres(values.consts.postgres_container_name, "postgres_image", pg_config, perm_container) %}

{% set postgres = tpl.deps.postgres(
values.consts.postgres_container_name,
values.home_assistant.postgres_image_selector,
pg_config, perm_container
) %}

{% do init.set_user(0, 0) %}
{% do init.add_caps(["CHOWN", "FOWNER", "DAC_OVERRIDE"]) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
TZ: Europe/Paris

home_assistant:
postgres_image_selector: postgres_17_image
db_password: db-home-assistant-password
db_user: home-assistant
db_name: home-assistant
Expand Down
2 changes: 1 addition & 1 deletion ix-dev/stable/nextcloud/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ sources:
- https://github.com/truenas/charts/tree/master/charts/nextcloud
title: Nextcloud
train: stable
version: 1.4.16
version: 1.5.0
5 changes: 4 additions & 1 deletion ix-dev/stable/nextcloud/ix_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ images:
nginx_image:
repository: nginx
tag: 1.27.3
postgres_image:
postgres_13_image:
repository: postgres
tag: 13.18
postgres_17_image:
repository: postgres
tag: "17.2"
redis_image:
repository: bitnami/redis
tag: 7.4.1
Expand Down
16 changes: 16 additions & 0 deletions ix-dev/stable/nextcloud/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ questions:
schema:
type: dict
attrs:
- variable: postgres_image_selector
label: Postgres Image (CAUTION)
description: |
If you are changing this after the postgres directory has been initialized,</br>
STOP! and make sure you have a backup of your data.</br>
Changing this will trigger an one way database upgrade.</br>
If something goes wrong, you will have to restore from backup.
schema:
type: string
default: postgres_13_image
required: true
enum:
- value: postgres_13_image
description: Postgres 13
- value: postgres_17_image
description: Postgres 17
- variable: admin_user
label: Admin User
description: The admin user for Nextcloud.
Expand Down
6 changes: 5 additions & 1 deletion ix-dev/stable/nextcloud/templates/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@
"database": values.consts.db_name,
"volume": values.storage.postgres_data,
} %}
{% set postgres = tpl.deps.postgres(values.consts.postgres_container_name, "postgres_image", pg_config, perm_container) %}
{% set postgres = tpl.deps.postgres(
values.consts.postgres_container_name,
values.nextcloud.postgres_image_selector,
pg_config, perm_container
) %}

{% do tpl.funcs.disallow_chars(values.nextcloud.redis_password, ["&", "@", "#", "%"], "redis_password") %}
{% set redis_config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resources:
memory: 4096

nextcloud:
postgres_image_selector: postgres_17_image
admin_user: admin
admin_password: password
apt_packages:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resources:
memory: 4096

nextcloud:
postgres_image_selector: postgres_17_image
admin_user: admin
admin_password: password
apt_packages:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resources:
memory: 4096

nextcloud:
postgres_image_selector: postgres_17_image
admin_user: admin
admin_password: password
apt_packages:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resources:
memory: 4096

nextcloud:
postgres_image_selector: postgres_17_image
admin_user: admin
admin_password: password
apt_packages:
Expand Down

0 comments on commit 0202622

Please sign in to comment.