diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index e94e5d6c86..f5ea8aeb79 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -299,8 +299,8 @@ class PlayContext(Base): setattr(new_info, attr, variables[variable_name]) # make sure we get port defaults if needed - if newinfo.port is None and C.DEFAULT_REMOTE_PORT is not None: - newinfo.port = int(C.DEFAULT_REMOTE_PORT) + if new_info.port is None and C.DEFAULT_REMOTE_PORT is not None: + new_info.port = int(C.DEFAULT_REMOTE_PORT) # become legacy updates if not new_info.become_pass: