56 lines
1.7 KiB
HCL
56 lines
1.7 KiB
HCL
vault { address = "http://vault:8200" }
|
|
auto_auth {
|
|
method "approle" {
|
|
config = {
|
|
role_id_file_path = "/etc/agent/role-id"
|
|
secret_id_file_path = "/etc/agent/secret-id"
|
|
remove_secret_id_file_after_reading = false
|
|
}
|
|
}
|
|
}
|
|
template_config {
|
|
static_secret_render_interval = "10s"
|
|
exit_on_retry_failure = true
|
|
}
|
|
|
|
env_template "TLS_CA" {
|
|
contents = "{{ with secret \"kv/data/tls\" }}{{ .Data.data.ca }}{{ end }}"
|
|
error_on_missing_key = true
|
|
}
|
|
|
|
env_template "SXCHNGE_NOTIFICATIONS_PRODUCT_TOKEN" {
|
|
contents = "{{ with secret \"kv/data/caller\" }}{{ .Data.data.token }}{{ end }}"
|
|
error_on_missing_key = true
|
|
}
|
|
|
|
env_template "SXCHNGE_NATS_URL" {
|
|
contents = "{{ with secret \"kv/data/nats\" }}nats://{{ .Data.data.token }}@nats:4222{{ end }}"
|
|
error_on_missing_key = true
|
|
}
|
|
|
|
env_template "TLS_CERT" {
|
|
contents = "{{ with secret \"kv/data/notifications-tls\" }}{{ .Data.data.certificate }}{{ end }}"
|
|
error_on_missing_key = true
|
|
}
|
|
|
|
env_template "TLS_KEY" {
|
|
contents = "{{ with secret \"kv/data/notifications-tls\" }}{{ .Data.data.private_key }}{{ end }}"
|
|
error_on_missing_key = true
|
|
}
|
|
|
|
env_template "EMAIL_API_KEY" {
|
|
contents = "{{ with secret \"kv/data/email\" }}{{ .Data.data.api_key }}{{ end }}"
|
|
error_on_missing_key = true
|
|
}
|
|
|
|
env_template "EMAIL_CONFIG" {
|
|
contents = "{{ with secret \"kv/data/email\" }}email:\n driver: {{ .Data.data.driver | toJSON }}\n settings:\n api_key_env: EMAIL_API_KEY\n sender_address: {{ .Data.data.sender_address | toJSON }}\n sender_name: {{ .Data.data.sender_name | toJSON }}\n{{ end }}"
|
|
error_on_missing_key = true
|
|
}
|
|
|
|
exec {
|
|
command = ["/usr/local/bin/start-service"]
|
|
restart_on_secret_changes = "always"
|
|
restart_stop_signal = "SIGTERM"
|
|
}
|