Ensure port is (re)set for delegated-to hosts

Fixes #13265
This commit is contained in:
James Cammarata 2015-11-30 14:39:49 -05:00
commit cc36eedf76
2 changed files with 23 additions and 0 deletions

View file

@ -444,8 +444,15 @@ class VariableManager:
continue
# a dictionary of variables to use if we have to create a new host below
# we set the default port based on the default transport here, to make sure
# we use the proper default for windows
new_port = C.DEFAULT_REMOTE_PORT
if C.DEFAULT_TRANSPORT == 'winrm':
new_port = 5986
new_delegated_host_vars = dict(
ansible_host=delegated_host_name,
ansible_port=new_port,
ansible_user=C.DEFAULT_REMOTE_USER,
ansible_connection=C.DEFAULT_TRANSPORT,
)