From eecbaee7f4b1e36be504d4576f92b329e1ad2b79 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 24 May 2022 09:11:35 -0400 Subject: [PATCH] Fix windows connection options (#77844) * winrm, psrps added missing var entry this handles issue with the default being set to inventory_hostname but defaults not being templated implicitly fixes #77841 --- changelogs/fragments/windows_conn_option_fix.yml | 3 +++ lib/ansible/plugins/connection/psrp.py | 1 + lib/ansible/plugins/connection/winrm.py | 1 + 3 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/windows_conn_option_fix.yml diff --git a/changelogs/fragments/windows_conn_option_fix.yml b/changelogs/fragments/windows_conn_option_fix.yml new file mode 100644 index 00000000000..9e693bbfb13 --- /dev/null +++ b/changelogs/fragments/windows_conn_option_fix.yml @@ -0,0 +1,3 @@ +bugfixes: + - winrm connection now handles default to inventory_hostname correctly. + - psrp connection now handles default to inventory_hostname correctly. diff --git a/lib/ansible/plugins/connection/psrp.py b/lib/ansible/plugins/connection/psrp.py index daa3c8488af..dfcf0e5488e 100644 --- a/lib/ansible/plugins/connection/psrp.py +++ b/lib/ansible/plugins/connection/psrp.py @@ -25,6 +25,7 @@ options: default: inventory_hostname type: str vars: + - name: inventory_hostname - name: ansible_host - name: ansible_psrp_host remote_user: diff --git a/lib/ansible/plugins/connection/winrm.py b/lib/ansible/plugins/connection/winrm.py index 4f513a89410..58df466e25b 100644 --- a/lib/ansible/plugins/connection/winrm.py +++ b/lib/ansible/plugins/connection/winrm.py @@ -25,6 +25,7 @@ DOCUMENTATION = """ - Address of the windows machine default: inventory_hostname vars: + - name: inventory_hostname - name: ansible_host - name: ansible_winrm_host type: str