diff options
-rw-r--r-- | changelogs/fragments/set-ssh-host_key_checking-defaults.yaml | 2 | ||||
-rw-r--r-- | lib/ansible/plugins/connection/ssh.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/changelogs/fragments/set-ssh-host_key_checking-defaults.yaml b/changelogs/fragments/set-ssh-host_key_checking-defaults.yaml new file mode 100644 index 0000000000..45181cdc9f --- /dev/null +++ b/changelogs/fragments/set-ssh-host_key_checking-defaults.yaml @@ -0,0 +1,2 @@ +bugfixes: + - set ssh host_key_checking defaults to True, restoring original behaviour (https://github.com/ansible/ansible/issues/75168) diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py index 3f812c1cb1..cc2aff8d12 100644 --- a/lib/ansible/plugins/connection/ssh.py +++ b/lib/ansible/plugins/connection/ssh.py @@ -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 @@ -666,7 +667,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") |