Can I bypass host key checking in Ansible? I'm running an Ansible playbook with a subtle hack to work on an arbitrary port forwarded port (so I can use one machine with no direct access to lots of machines).  

I've got a pre-task to change the ansible_port variable, so then when I start running my real tasks and roles, I get prompted to accept the hostkeys for localhost on some random port.  

Because I am naive and don't care about security, I would like ssh to auto-accept and redirect to /dev/null (or another file for logging). 

Is this possible?
This is typically done by setting the following value in ansible.cfg:

[defaults]
host_key_checking = False


If you don't want to modify ansible.cfg you can set an environment variable like so:

export ANSIBLE_HOST_KEY_CHECKING=False


Source: http://docs.ansible.com/ansible/intro_getting_started.html#host-key-checking