mitchellh/vagrant — pull request #2203 by copperlight (2013-09-14 03:08:50+00:00)
Title: add ansible.host_key_checking configuration parameter

Ansible 1.2.1 enables SSH host key checking by default, which results in the following errors when it is used as a provisioner with official boxes:

```
[default] Running provisioner: ansible...

PLAY [graphite.local] *********************************************************

GATHERING FACTS ***************************************************************
fatal: [192.168.100.10] => {'msg': "FAILED: (25, 'Inappropriate ioctl for device')", 'failed': True}

TASK: [apt update_cache=yes cache_valid_time=86400] ***************************
FATAL: no hosts matched or all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
to retry, use: --limit @/var/tmp/ansible/playbook.retry

192.168.100.10 : ok=0 changed=0 unreachable=1 failed=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
```

While this improves the default security stance of Ansible, it disrupts the flow of Vagrant runs. The host key checking behavior of Ansible can be over-ridden by setting the following environment variable:

```
export ANSIBLE_HOST_KEY_CHECKING=false
```

This patch adds a new configuration parameter `ansible.host_key_checking` to the Ansible provisioner that controls the value of this environment variable. It defaults to true, to match the default configuration and security stance of Ansible, but it can be set to false to allow smooth Vagrant runs with official boxes.