elasticsearch/prep.d/10-rand-secrets.sh

11 lines
391 B
Bash
Raw Normal View History

#!/bin/sh
set -euo pipefail
2024-01-25 16:45:30 +01:00
[[ template "common/vault.rand_secrets" dict "ctx" . "keys" (coll.Slice "es_bootstrap_pwd" "exporter_pwd" "elastic_pwd") ]]
[[- range $k, $v := .elasticsearch.server.users ]]
[[- if not (has $v "password") ]]
[[ template "common/vault.rand_secrets" dict "ctx" $ "keys" (coll.Slice (printf "%s_pwd" ($k | regexp.Replace "\\-" "_"))) ]]
[[- end ]]
[[- end ]]