Commit 3bfeb548 authored by yveslaroche's avatar yveslaroche

Fix Ansible inventory path on Windows

Convert the path to use a '/' separator.
parent ca53d7e4
......@@ -191,7 +191,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
if len(p.config.InventoryFile) > 0 {
ui.Message("Uploading inventory file...")
src := p.config.InventoryFile
dst := filepath.Join(p.config.StagingDir, filepath.Base(src))
dst := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(src)))
if err := p.uploadFile(ui, comm, dst, src); err != nil {
return fmt.Errorf("Error uploading inventory file: %s", err)
}
......@@ -259,7 +259,7 @@ func (p *Provisioner) executeAnsible(ui packer.Ui, comm packer.Communicator) err
// with a single host.
inventory := "\"127.0.0.1,\""
if len(p.config.InventoryFile) > 0 {
inventory = filepath.Join(p.config.StagingDir, filepath.Base(p.config.InventoryFile))
inventory = filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(p.config.InventoryFile)))
}
extraArgs := ""
......
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