From bc829f64bc66824ca3ee1dfadca4b4db2db15449 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 21 Apr 2024 20:39:32 +0200 Subject: [PATCH] [PR #8257/af1c5dd7 backport][stable-8] Add accept-new as valid option for ssh_config host key checking (#8267) Add accept-new as valid option for ssh_config host key checking (#8257) * Add accept-new as valid option for host key checking * Add changelog fragment for #8257 * Apply suggestions from code review Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein (cherry picked from commit af1c5dd7853df3f99c7ee2dfec13df00e7c2dc74) Co-authored-by: Maxopoly --- .../8257-ssh-config-hostkey-support-accept-new.yaml | 2 ++ plugins/modules/ssh_config.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/8257-ssh-config-hostkey-support-accept-new.yaml diff --git a/changelogs/fragments/8257-ssh-config-hostkey-support-accept-new.yaml b/changelogs/fragments/8257-ssh-config-hostkey-support-accept-new.yaml new file mode 100644 index 0000000000..ca1d61aefd --- /dev/null +++ b/changelogs/fragments/8257-ssh-config-hostkey-support-accept-new.yaml @@ -0,0 +1,2 @@ +minor_changes: + - ssh_config - allow ``accept-new`` as valid value for ``strict_host_key_checking`` (https://github.com/ansible-collections/community.general/pull/8257). diff --git a/plugins/modules/ssh_config.py b/plugins/modules/ssh_config.py index e89e087b39..d974f45373 100644 --- a/plugins/modules/ssh_config.py +++ b/plugins/modules/ssh_config.py @@ -88,7 +88,8 @@ options: strict_host_key_checking: description: - Whether to strictly check the host key when doing connections to the remote host. - choices: [ 'yes', 'no', 'ask' ] + - The value V(accept-new) is supported since community.general 8.6.0. + choices: [ 'yes', 'no', 'ask', 'accept-new' ] type: str proxycommand: description: @@ -370,7 +371,7 @@ def main(): strict_host_key_checking=dict( type='str', default=None, - choices=['yes', 'no', 'ask'] + choices=['yes', 'no', 'ask', 'accept-new'], ), controlmaster=dict(type='str', default=None, choices=['yes', 'no', 'ask', 'auto', 'autoask']), controlpath=dict(type='str', default=None),