From 3de8561a755f877184f4a0264a74cf7d6f60eac6 Mon Sep 17 00:00:00 2001 From: ephemeralsnow Date: Tue, 9 Feb 2016 20:03:05 +0900 Subject: [PATCH] Add chmod to chef-solo provisioner --- provisioner/chef-solo/provisioner.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/provisioner/chef-solo/provisioner.go b/provisioner/chef-solo/provisioner.go index 607b98645..318ce9d72 100644 --- a/provisioner/chef-solo/provisioner.go +++ b/provisioner/chef-solo/provisioner.go @@ -422,6 +422,15 @@ func (p *Provisioner) createDir(ui packer.Ui, comm packer.Communicator, dir stri return fmt.Errorf("Non-zero exit status. See output above for more info.") } + // Chmod the directory to 0777 just so that we can access it as our user + cmd = &packer.RemoteCmd{Command: p.guestCommands.Chmod(dir, "0777")} + if err := cmd.StartWithUi(comm, ui); err != nil { + return err + } + if cmd.ExitStatus != 0 { + return fmt.Errorf("Non-zero exit status. See output above for more info.") + } + return nil }