Ansible: os.Environ() should always be passed to the ansible command.

Fixes GH-3271

Regression introduced in GH-3203
This commit is contained in:
Rickard von Essen 2016-02-26 20:49:37 +01:00
parent cc8974754f
commit f823725e53
1 changed files with 1 additions and 1 deletions

View File

@ -262,8 +262,8 @@ func (p *Provisioner) executeAnsible(ui packer.Ui, comm packer.Communicator, pri
cmd := exec.Command(p.config.Command, args...) cmd := exec.Command(p.config.Command, args...)
cmd.Env = os.Environ()
if len(envvars) > 0 { if len(envvars) > 0 {
cmd.Env = os.Environ()
cmd.Env = append(cmd.Env, envvars...) cmd.Env = append(cmd.Env, envvars...)
} else if !checkHostKey { } else if !checkHostKey {
cmd.Env = append(cmd.Env, "ANSIBLE_HOST_KEY_CHECKING=False") cmd.Env = append(cmd.Env, "ANSIBLE_HOST_KEY_CHECKING=False")