diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py index 3993878cbd0..2de190ce1dc 100644 --- a/lib/ansible/inventory/host.py +++ b/lib/ansible/inventory/host.py @@ -121,13 +121,6 @@ class Host: results = combine_vars(results, self.vars) results['inventory_hostname'] = self.name results['inventory_hostname_short'] = self.name.split('.')[0] - - 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 - results['group_names'] = sorted([ g.name for g in groups if g.name != 'all']) return results diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index e004ee8bb75..8d5f5f052fa 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -146,10 +146,10 @@ class InventoryParser(object): (k,v) = t.split("=", 1) except ValueError, e: raise AnsibleError("Invalid ini entry in %s: %s - %s" % (self.filename, t, str(e))) + v = self._parse_value(v) if k == 'ansible_ssh_host': - host.ipv4_address = self._parse_value(v) - else: - host.set_variable(k, self._parse_value(v)) + host.ipv4_address = v + host.set_variable(k, v) self.groups[active_group_name].add_host(host) # [southeast:children]