From 6cbd94dfaee3b800303a30c6e6a5337bb0ddc903 Mon Sep 17 00:00:00 2001 From: Stoned Elipot Date: Mon, 2 Sep 2013 12:26:02 +0200 Subject: [PATCH] Avoid duplicates of the 'all' group when using inventory script. Do not recreate an 'all' group when it is in the inventory script's output, but use the one created upfront. --- lib/ansible/inventory/script.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/inventory/script.py b/lib/ansible/inventory/script.py index 42c46559d99..9474c3ebd76 100644 --- a/lib/ansible/inventory/script.py +++ b/lib/ansible/inventory/script.py @@ -72,7 +72,10 @@ class InventoryScript(object): self.host_vars_from_top = data['hostvars'] continue - group = groups[group_name] = Group(group_name) + if group_name != all.name: + group = groups[group_name] = Group(group_name) + else: + group = all host = None if not isinstance(data, dict):