Skip to content

Commit

Permalink
Made groups.groupname and group_names variables accessible in playbooks.
Browse files Browse the repository at this point in the history
Also modified code that feeds the groups data structure to templates so
that it resolves groups inside of groups to hostnames.
  • Loading branch information
tima committed Sep 10, 2012
1 parent 20fc6a2 commit 9d5a79f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/ansible/runner/__init__.py
Expand Up @@ -319,11 +319,7 @@ def _executor_internal_inner(self, host, inject, port, is_chained=False):
# 'hostvars' variable contains variables for each host name # 'hostvars' variable contains variables for each host name
# ... and is set elsewhere # ... and is set elsewhere
# 'inventory_hostname' is also set elsewhere # 'inventory_hostname' is also set elsewhere
group_hosts = {} inject['groups'] = self.inventory.groups_list()
for g in self.inventory.groups:
group_hosts[g.name] = [ h.name for h in g.hosts ]
inject['groups'] = group_hosts

# allow module args to work as a dictionary # allow module args to work as a dictionary
# though it is usually a string # though it is usually a string
new_args = "" new_args = ""
Expand Down

0 comments on commit 9d5a79f

Please sign in to comment.