2021-10-13 10:02:40 +00:00
|
|
|
{{/* Define the configmap */}}
|
|
|
|
{{- define "hass.configmap" -}}
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: {{ include "common.names.fullname" . }}-init
|
|
|
|
data:
|
|
|
|
init.sh: |-
|
|
|
|
#!/bin/sh
|
|
|
|
if test -f "/config/configuration.yaml"; then
|
|
|
|
echo "configuration.yaml exists."
|
|
|
|
if grep -q recorder: "/config/configuration.yaml"; then
|
|
|
|
echo "configuration.yaml already contains recorder"
|
2021-10-13 12:22:10 +00:00
|
|
|
else
|
|
|
|
cat /config/init/recorder.default >> /config/configuration.yaml
|
2021-10-13 10:02:40 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "configuration.yaml does NOT exist."
|
|
|
|
cp /config/init/configuration.yaml.default /config/configuration.yaml
|
2021-10-13 12:22:10 +00:00
|
|
|
cat /config/init/recorder.default >> /config/configuration.yaml
|
2021-10-13 10:02:40 +00:00
|
|
|
fi
|
|
|
|
configuration.yaml.default: |-
|
|
|
|
# Configure a default setup of Home Assistant (frontend, api, etc)
|
|
|
|
default_config:
|
|
|
|
|
|
|
|
# Text to speech
|
|
|
|
tts:
|
|
|
|
- platform: google_translate
|
|
|
|
|
|
|
|
# Example Includes
|
|
|
|
# group: !include groups.yaml
|
|
|
|
# automation: !include automations.yaml
|
|
|
|
# script: !include scripts.yaml
|
|
|
|
# scene: !include scenes.yaml
|
2021-10-13 12:22:10 +00:00
|
|
|
recorder.default: |-
|
2021-10-13 10:02:40 +00:00
|
|
|
|
|
|
|
recorder:
|
2021-10-13 12:22:10 +00:00
|
|
|
purge_keep_days: 30
|
|
|
|
commit_interval: 3
|
2021-10-13 10:02:40 +00:00
|
|
|
db_url: {{ ( printf "%s?client_encoding=utf8" ( .Values.postgresql.url.complete | trimAll "\"" ) ) | quote }}
|
|
|
|
|
2021-10-13 12:22:10 +00:00
|
|
|
|
2021-10-13 10:02:40 +00:00
|
|
|
{{- end -}}
|