diff --git a/lib/ansible/inventory.py b/lib/ansible/inventory.py index 6fb96d79316..b707b1596ff 100644 --- a/lib/ansible/inventory.py +++ b/lib/ansible/inventory.py @@ -88,8 +88,8 @@ class Inventory(object): def get_host(self, hostname): for group in self.groups: - for host in group.get_hosts(): - if hostname == host.name: + for host in group.get_hosts(): + if hostname == host.name: return host return None