You can do a ssh-keyscan and generate the production servers and make it into a known_hosts file, this will remove all your tests servers and keep production in there. Something like:ssh-keyscan -t rsa -H "<servername>,<servername2>,<servername3>" > ~/.ssh/known_hosts
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, <junkmailt...@gmail.com> 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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/aea601ab-0423-4cf5-8111-380bf4384f94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.