From df93d7dd977afff12199314f89a61a0de733074b Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 19 Apr 2013 19:01:19 -0400 Subject: [PATCH] Ignore inventory config files when using an inventory directory. --- lib/ansible/inventory/dir.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/inventory/dir.py b/lib/ansible/inventory/dir.py index 89b290d4a50..0db6ba2dff2 100644 --- a/lib/ansible/inventory/dir.py +++ b/lib/ansible/inventory/dir.py @@ -36,9 +36,14 @@ class InventoryDirectory(object): self.parsers = [] self.hosts = {} self.groups = {} + for i in self.names: + if i.endswith("~") or i.endswith(".orig") or i.endswith(".bak"): continue + if i.endswith(".ini"): + # configuration file for an inventory script + continue if i.endswith(".retry"): # this file is generated on a failed playbook and should only be # used when run specifically