diff --git a/provisioner/converge/provisioner.go b/provisioner/converge/provisioner.go index 17fab3f5b..013b190f7 100644 --- a/provisioner/converge/provisioner.go +++ b/provisioner/converge/provisioner.go @@ -48,9 +48,9 @@ type ModuleDir struct { // Module contains information needed to run a module type Module struct { - Module string `mapstructure:"module"` - Directory string `mapstructure:"directory"` - Params map[string]string `mapstucture:"params"` + Module string `mapstructure:"module"` + WorkingDirectory string `mapstructure:"working_directory"` + Params map[string]string `mapstucture:"params"` } // Provisioner for Converge @@ -95,8 +95,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { if module.Module == "" { return fmt.Errorf("Module (\"module\" key) is required in Converge module #%d", i) } - if module.Directory == "" { - p.config.Modules[i].Directory = "/tmp" + if module.WorkingDirectory == "" { + p.config.Modules[i].WorkingDirectory = "/tmp" } } @@ -194,7 +194,7 @@ func (p *Provisioner) applyModules(ui packer.Ui, comm packer.Communicator) error cmd := &packer.RemoteCmd{ Command: fmt.Sprintf( "cd %s && converge apply --local --log-level=WARNING --paramsJSON '%s' %s", - module.Directory, + module.WorkingDirectory, string(params), module.Module, ), diff --git a/provisioner/converge/provisioner_test.go b/provisioner/converge/provisioner_test.go index 1be925fef..687210139 100644 --- a/provisioner/converge/provisioner_test.go +++ b/provisioner/converge/provisioner_test.go @@ -46,8 +46,8 @@ func TestProvisionerPrepare(t *testing.T) { t.Errorf("err: %s", err) } - if p.config.Modules[0].Directory != "/tmp" { - t.Errorf("unexpected module directory: %s", p.config.Modules[0].Directory) + if p.config.Modules[0].WorkingDirectory != "/tmp" { + t.Errorf("unexpected module directory: %s", p.config.Modules[0].WorkingDirectory) } })