You could perhaps achieve this with a crafted ssh_config. Especially if
your hosts are named predictably.

Consider if your production hosts have names in the form
host5.prod.domain.net and other environments are different such as
host3.stage.domain.net

A corresponding ssh_config might be (note that first option match wins):

Host *.prod.domain.net
StrictHostKeyChecking yes

Host *.domain.net
StrictHostKeyChecking no

Hope this helps


On 27 February 2015 at 22:31, <[email protected]> wrote:

Is it possible to set ANSIBLE_HOST_KEY_CHECKING on a per host or host group
> basis? This would help prevent my known_hosts file from becoming cluttered
> with test boxes but still ensure when I talk to production hosts I can
> verify their identity.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/aea601ab-0423-4cf5-8111-380bf4384f94%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/aea601ab-0423-4cf5-8111-380bf4384f94%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
​

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAAnNz0MVTrzB07MGD_Ox2EZdj30LM%3DDJHvGc0_da1SSwuRkOZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to