Created
February 6, 2014 00:48
-
-
Save medlefsen/8836433 to your computer and use it in GitHub Desktop.
Ansible patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/ansible/runner/action_plugins/group_by.py b/lib/ansible/runner/action_plugins/group_by.py | |
index f8b4f31..4d6205c 100644 | |
--- a/lib/ansible/runner/action_plugins/group_by.py | |
+++ b/lib/ansible/runner/action_plugins/group_by.py | |
@@ -83,7 +83,8 @@ class ActionModule(object): | |
inv_group = ansible.inventory.Group(name=group) | |
inventory.add_group(inv_group) | |
for host in hosts: | |
- del self.runner.inventory._vars_per_host[host] | |
+ if host in self.runner.inventory._vars_per_host: | |
+ del self.runner.inventory._vars_per_host[host] | |
inv_host = inventory.get_host(host) | |
if not inv_host: | |
inv_host = ansible.inventory.Host(name=host) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment