patternMajor
Can I bypass host key checking in Ansible?
Viewed 0 times
canansiblecheckinghostbypasskey
Problem
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
Because I am naive and don't care about security, I would like ssh to auto-accept and redirect to
Is this possible?
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?
Solution
This is typically done by setting the following value in
If you don't want to modify
Source: http://docs.ansible.com/ansible/intro_getting_started.html#host-key-checking
ansible.cfg:[defaults]
host_key_checking = FalseIf you don't want to modify
ansible.cfg you can set an environment variable like so:export ANSIBLE_HOST_KEY_CHECKING=FalseSource: http://docs.ansible.com/ansible/intro_getting_started.html#host-key-checking
Code Snippets
[defaults]
host_key_checking = Falseexport ANSIBLE_HOST_KEY_CHECKING=FalseContext
StackExchange DevOps Q#725, answer score: 37
Revisions (0)
No revisions yet.