Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add '-ssh-external' option to prepare subcommand #234

Merged
merged 1 commit into from
Oct 31, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion commands/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type PrepareCmd struct {

askSudoPassword bool
askKeyPassword bool

sshExternal bool
}

// Name return subcommand name
Expand All @@ -60,8 +62,9 @@ func (*PrepareCmd) Usage() string {
[-config=/path/to/config.toml]
[-ask-key-password]
[-debug]
[-ssh-external]

[SERVER]...
[SERVER]...
`
}

Expand All @@ -88,6 +91,13 @@ func (p *PrepareCmd) SetFlags(f *flag.FlagSet) {
false,
"[Deprecated] THIS OPTION WAS REMOVED FOR SECURITY REASONS. Define NOPASSWD in /etc/sudoers on target servers and use SSH key-based authentication",
)

f.BoolVar(
&p.sshExternal,
"ssh-external",
false,
"Use external ssh command. Default: Use the Go native implementation")

}

// Execute execute
Expand Down Expand Up @@ -133,6 +143,7 @@ func (p *PrepareCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{
}

c.Conf.Debug = p.debug
c.Conf.SSHExternal = p.sshExternal

// Set up custom logger
logger := util.NewCustomLogger(c.ServerInfo{})
Expand Down