#!/bin/sh set -euo pipefail [[ 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 ]]