Add ServerName to Vault Agent template config (#11288)

* Add ServerName to Vault Agent template config

* Remove newline

* Add changelog for 11288

* Update changelog/11288.txt

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
This commit is contained in:
Pierce Bartine 2021-05-13 07:18:15 -07:00 committed by GitHub
parent 502cf3b212
commit e56982f782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

3
changelog/11288.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
agent: Fixed agent templating to use configured tls servername values
```

View File

@ -274,12 +274,13 @@ func newRunnerConfig(sc *ServerConfig, templates ctconfig.TemplateConfigs) (*ctc
skipVerify := sc.AgentConfig.Vault.TLSSkipVerify
verify := !skipVerify
conf.Vault.SSL = &ctconfig.SSLConfig{
Enabled: pointerutil.BoolPtr(true),
Verify: &verify,
Cert: &sc.AgentConfig.Vault.ClientCert,
Key: &sc.AgentConfig.Vault.ClientKey,
CaCert: &sc.AgentConfig.Vault.CACert,
CaPath: &sc.AgentConfig.Vault.CAPath,
Enabled: pointerutil.BoolPtr(true),
Verify: &verify,
Cert: &sc.AgentConfig.Vault.ClientCert,
Key: &sc.AgentConfig.Vault.ClientKey,
CaCert: &sc.AgentConfig.Vault.CACert,
CaPath: &sc.AgentConfig.Vault.CAPath,
ServerName: &sc.AgentConfig.Vault.TLSServerName,
}
}
enabled := attempts > 0