Allow to set the ssh user, and registry username and password.

This commit is contained in:
Mariano Cano 2019-11-11 11:37:54 -08:00 committed by max furman
parent cf592fa0e1
commit 5c24ca81f4

View file

@ -35,8 +35,11 @@ var SSHTemplateData = map[string]string{
// and references the step known_hosts file // and references the step known_hosts file
"config.tpl": `Match exec "step ssh check-host %h" "config.tpl": `Match exec "step ssh check-host %h"
ForwardAgent yes ForwardAgent yes
{{- if .User.User }}
User {{.User.User}}
{{- end }}
UserKnownHostsFile {{.User.StepPath}}/ssh/known_hosts UserKnownHostsFile {{.User.StepPath}}/ssh/known_hosts
ProxyCommand step ssh proxycommand %r %h %p`, ProxyCommand step ssh proxycommand {{- if .User.RegistryUsername}} --username {{.User.RegistryUsername}}{{end}}{{- if .User.RegistryPassword}} --password {{.User.RegistryPassword}}{{end}} %r %h %p`,
// known_hosts.tpl authorizes the ssh hosts key // known_hosts.tpl authorizes the ssh hosts key
"known_hosts.tpl": `@cert-authority * {{.Step.SSH.HostKey.Type}} {{.Step.SSH.HostKey.Marshal | toString | b64enc}} "known_hosts.tpl": `@cert-authority * {{.Step.SSH.HostKey.Type}} {{.Step.SSH.HostKey.Marshal | toString | b64enc}}