Skip to content

Commit

Permalink
Merge pull request #3 from akurz/fix-remote-ssh-commands
Browse files Browse the repository at this point in the history
Fix remote ssh commands
  • Loading branch information
Mwea authored Sep 2, 2018
2 parents 61f6a3e + 5d4e76e commit 52343c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion chefsolo/provisioner_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ func Provisioner() terraform.ResourceProvisioner {
Type: schema.TypeString,
Optional: true,
},
"recreate_client": {
"skip_install": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"prevent_sudo": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -178,6 +179,7 @@ func configureProvisioner(d *schema.ResourceData, osType afero.Fs) (*provisioner
ClientOptions: getStringList(d.Get("client_options")),
Environment: d.Get("environment").(string),
UsePolicyfile: d.Get("use_policyfile").(bool),
SkipInstall: d.Get("skip_install").(bool),
HTTPProxy: d.Get("http_proxy").(string),
HTTPSProxy: d.Get("https_proxy").(string),
NOProxy: getStringList(d.Get("no_proxy")),
Expand Down
8 changes: 7 additions & 1 deletion chefsolo/provisioner_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ func getCommunicator(ctx context.Context, o terraform.UIOutput, s *terraform.Ins
if err != nil {
return nil, err
}
defer comm.Disconnect()

// Wait for the context to end and then disconnect
go func() {
<-ctx.Done()
comm.Disconnect()
}()

return comm, err
}

0 comments on commit 52343c9

Please sign in to comment.