Nicer parsing of "auth_servers" config option

This commit is contained in:
Ev Kontsevoy 2016-06-12 16:24:38 -07:00
parent 1bcd32e5ca
commit 45f1986d88
5 changed files with 26 additions and 3 deletions

View file

@ -126,7 +126,11 @@ func ApplyFileConfig(fc *FileConfig, cfg *service.Config) error {
if len(fc.AuthServers) > 0 {
cfg.AuthServers = make([]utils.NetAddr, 0, len(fc.AuthServers))
for _, as := range fc.AuthServers {
addr, err := utils.ParseAddr(as)
addr, err := utils.ParseHostPortAddr(as, defaults.AuthListenPort)
if err != nil {
return trace.Wrap(err)
}
if err != nil {
return trace.Errorf("cannot parse auth server address: '%v'", as)
}

View file

@ -121,7 +121,7 @@ teleport:
advertise_ip: 10.5.5.5
nodename: hvostongo.example.org
auth_servers:
- tcp://auth.server.example.org:3024
- auth.server.example.org:3024
auth_token: xxxyyy
log:
output: stderr

View file

@ -13,7 +13,7 @@
NODES = {
"a-auth" => "10.0.10.10",
# "a-proxy" => "10.0.10.11",
# "a-node" => "10.0.10.12",
"a-node" => "10.0.10.12",
"b-auth" => "10.0.10.20",
# "b-proxy" => "10.0.10.21",

View file

@ -8,6 +8,8 @@ teleport:
auth_service:
enabled: yes
cluster_name: cluster-a
tokens:
- "node:hello"
trusted_clusters:
- key_file: /opt/shared/cluster-b
allow_logins: root,vagrant

View file

@ -0,0 +1,17 @@
# Node for cluster-A
teleport:
nodename: node
auth_token: hello
auth_servers: [a-auth]
log:
output: stderr
severity: INFO
auth_service:
enabled: no
ssh_service:
enabled: yes
proxy_service:
enabled: no