From 3e79bfa2d6592809060623202c11a1a8e531b222 Mon Sep 17 00:00:00 2001 From: Dann Bohn Date: Mon, 20 Jul 2015 15:43:55 -0400 Subject: [PATCH] only set ansible_ssh_host if not already set --- lib/ansible/inventory/host.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py index c8083edb928..3993878cbd0 100644 --- a/lib/ansible/inventory/host.py +++ b/lib/ansible/inventory/host.py @@ -121,7 +121,9 @@ class Host: results = combine_vars(results, self.vars) results['inventory_hostname'] = self.name results['inventory_hostname_short'] = self.name.split('.')[0] - results['ansible_ssh_host'] = self.ipv4_address + + if 'ansible_ssh_host' not in results: + results['ansible_ssh_host'] = self.ipv4_address if 'ansible_ssh_port' not in results: results['ansible_ssh_port'] = C.DEFAULT_REMOTE_PORT