Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit af6ce95

Browse files
author
Christian Haeusler
committed
Accept Hash for group children
A valid Ansible inventory would contain a Hash in a groups children value. So far we only used lists there and converted it to a hash. Now we intend to do group nesting and the code faile due to product not being a valid method on a hash. As there is nothing to do in this case, one more test for type Array prevents the code from failing.
1 parent 626a134 commit af6ce95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/ansible_hosts.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ groups = Marshal.load(Marshal.dump(@host_groups))
88

99
groups.each_value do |group|
1010
# Convert children to hashes
11-
if group and group.include?('children')
11+
if group and group.include?('children') and group['children'].class == Array
1212
group['children'] = Hash[group['children'].product([{}])]
1313
end
1414
end

0 commit comments

Comments
 (0)