SSH host key checking not enabled for proxied connections
Summary
(Summarize the bug encountered concisely)
Steps to reproduce
- Set
ssh_disable_host_key_checking
toyes
- Define the
ssh_proxy
host.
Expected behavior
Host key checking disabled for the proxied connection.
Actual behavior
Host key checking not disabled for the proxied connection.
Relevant logs and/or screenshots
Possible fixes
Check this out:
ansible_ssh_extra_args: >
{% if ssh_disable_host_key_checking %}-o StrictHostKeyChecking=no -o UserKnownHostsFile="/dev/null"{% endif %}
{% if ssh_proxy is defined %}-o ProxyCommand="ssh -q -W %h:%p {{ hostvars[ssh_proxy].ansible_user }}@{{ hostvars[ssh_proxy].ansible_host }}"{% endif %}