Commit 1984ce17 authored by Ross Smith II's avatar Ross Smith II

Merge pull request #1016 from jgornick/ansible-chdir

Update Ansible provisioner to set cwd to staging directory.
parents 2ab3346b d9fc06a1
......@@ -222,8 +222,8 @@ func (p *Provisioner) executeAnsible(ui packer.Ui, comm packer.Communicator) err
extraArgs = " " + strings.Join(p.config.ExtraArguments, " ")
}
command := fmt.Sprintf("%s %s%s -c local -i \"127.0.0.1,\"",
p.config.Command, playbook, extraArgs)
command := fmt.Sprintf("cd %s && %s %s%s -c local -i \"127.0.0.1,\"",
p.config.StagingDir, p.config.Command, playbook, extraArgs)
ui.Message(fmt.Sprintf("Executing Ansible: %s", command))
cmd := &packer.RemoteCmd{
Command: command,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment