sudo prefix the command which cleans up `/srv/{salt,pillar}` as these are created with sudo in the packer driven salt bootstrapper

This commit is contained in:
Brett Russ 2017-08-11 21:26:16 -04:00
parent 850ae8ac65
commit 7192c46e46
1 changed files with 1 additions and 1 deletions

View File

@ -384,7 +384,7 @@ func (p *Provisioner) createDir(ui packer.Ui, comm packer.Communicator, dir stri
func (p *Provisioner) removeDir(ui packer.Ui, comm packer.Communicator, dir string) error {
ui.Message(fmt.Sprintf("Removing directory: %s", dir))
cmd := &packer.RemoteCmd{
Command: fmt.Sprintf("rm -rf '%s'", dir),
Command: fmt.Sprintf(p.sudo("rm -rf '%s'"), dir),
}
if err := cmd.StartWithUi(comm, ui); err != nil {
return err