diff --git a/lib/ansible/inventory/data.py b/lib/ansible/inventory/data.py index 7eb626d1e3..640a059f75 100644 --- a/lib/ansible/inventory/data.py +++ b/lib/ansible/inventory/data.py @@ -224,8 +224,8 @@ class InventoryData(object): def remove_host(self, host): - if host in self.hosts: - del self.hosts[host] + if host.name in self.hosts: + del self.hosts[host.name] for group in self.groups: g = self.groups[group]