append ANSIBLE_HOST_KEY_CHECKING correctly (#3568)

Append the ANSIBLE_HOST_KEY_CHECKING environment variable correctly
regardless of whether the template specifies some environment variables.
This commit is contained in:
Billie Cleek 2016-05-24 15:34:51 -07:00 committed by Chris Bednarski
parent 97772d0dee
commit 49067e732a

View File

@ -312,7 +312,9 @@ func (p *Provisioner) executeAnsible(ui packer.Ui, comm packer.Communicator, pri
cmd.Env = os.Environ()
if len(envvars) > 0 {
cmd.Env = append(cmd.Env, envvars...)
} else if !checkHostKey {
}
if !checkHostKey {
cmd.Env = append(cmd.Env, "ANSIBLE_HOST_KEY_CHECKING=False")
}