Files
nomad/command/agent/testdata/extra-vault.hcl
Luiz Aoqui 19241964a4 config: fix some issues with workload identity and multi Consul and Vault (#18590)
* config: fix multi consul and vault config parse

Capture the loop variable when parsing multiple Consul and Vault
configuration blocks so the duration parse function uses the correct
field when it's called later on.

* client: build Vault client with right config

When setting up the multiple Vault clients, the code was always loading
the default configuration, resulting in all clients to be configured the
same way.

* config: fix WorkloadIdentityConfig.Copy() method

Ensure `WorkloadIdentityConfig.Copy()` does not return the original
pointer for the `TTL` field.
2023-09-27 14:41:11 -03:00

36 lines
897 B
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
# this unnamed (default) config should merge cleanly onto the basic config
vault {
enabled = true
token = "abracadabra"
}
# these alternate configs should be added as an extra vault configs
vault {
name = "alternate"
address = "127.0.0.1:9501"
allow_unauthenticated = true
task_token_ttl = "5s"
enabled = true
token = "xyzzy"
ca_file = "/path/to/ca/file"
ca_path = "/path/to/ca"
cert_file = "/path/to/cert/file"
key_file = "/path/to/key/file"
tls_server_name = "barbaz"
tls_skip_verify = true
create_from_role = "test_role2"
}
vault {
name = "other"
address = "127.0.0.1:9502"
default_identity {
aud = ["vault-other.io"]
ttl = "4h"
}
}