set host_key_checking check to False, rather than if not (which captures False and None) (#75168)

* set host_key_checking check to False, rather than if not (which captures False and None)
* add host_key_checking default to ssh.py / update documentation
pull/75277/head
James Spurin 3 years ago committed by GitHub
parent 5e271dfc60
commit d527be8a52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- set ssh host_key_checking defaults to True, restoring original behaviour (https://github.com/ansible/ansible/issues/75168)

@ -33,6 +33,7 @@ DOCUMENTATION = '''
- name: delegated_vars['ansible_ssh_host']
host_key_checking:
description: Determines if ssh should check host keys
default: True
type: boolean
ini:
- section: defaults
@ -692,7 +693,7 @@ class Connection(ConnectionBase):
self._add_args(b_command, b_args, u"ansible.cfg set ssh_args")
# Now we add various arguments that have their own specific settings defined in docs above.
if not self.get_option('host_key_checking'):
if self.get_option('host_key_checking') is False:
b_args = (b"-o", b"StrictHostKeyChecking=no")
self._add_args(b_command, b_args, u"ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled")

Loading…
Cancel
Save