common/templates/vault.policies

12 lines
646 B
HCL

[[- /* vim: syntax=hcl
Add vault policices to a task */ -]]
[[- if and (has . "vault") (has .vault "policies") ]]
vault {
policies = [ [[- range $idx, $pol := .vault.policies ]][[ if ne $idx 0 ]],[[ end ]]"[[ $pol ]]"[[ end ]] ]
env = [[ if and (has .vault "env") (.vault.env) ]]true[[ else ]]false[[ end ]]
disable_file = [[ if and (has .vault "disable_file") (not .vault.disable_file) ]]false[[ else ]]true[[ end ]]
change_mode = "[[ if or (and (has .vault "env") (.vault.env)) (and (has .vault "disable_file") (not .vault.disable_file)) ]]restart[[ else ]]noop[[ end ]]"
}
[[- end ]]