From f17bdc4d616dbbe62d17721cd7aca806cb9530e0 Mon Sep 17 00:00:00 2001 From: Benno Joy Date: Mon, 22 Jun 2015 00:37:44 -0400 Subject: [PATCH] Set the ansible_ssh_port variable instead of saving it internally for Host Fixes #11330 --- lib/ansible/inventory/host.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py index 29d6afd9912..ffdbc6f9c3a 100644 --- a/lib/ansible/inventory/host.py +++ b/lib/ansible/inventory/host.py @@ -49,7 +49,6 @@ class Host: vars=self.vars.copy(), ipv4_address=self.ipv4_address, ipv6_address=self.ipv6_address, - port=self.port, gathered_facts=self._gathered_facts, groups=groups, ) @@ -61,7 +60,6 @@ class Host: self.vars = data.get('vars', dict()) self.ipv4_address = data.get('ipv4_address', '') self.ipv6_address = data.get('ipv6_address', '') - self.port = data.get('port') groups = data.get('groups', []) for group_data in groups: @@ -79,9 +77,9 @@ class Host: self.ipv6_address = name if port and port != C.DEFAULT_REMOTE_PORT: - self.port = int(port) + self.set_variable('ansible_ssh_port', int(port)) else: - self.port = C.DEFAULT_REMOTE_PORT + self.set_variable('ansible_ssh_port', C.DEFAULT_REMOTE_PORT) self._gathered_facts = False