Ansible Groups: Accept single item as String
Syntax errors in `ansible.groups` definition are not well handled: Error returned: undefined method `each' for "machine1":String (NoMethodError) Being tolerant here doesn't hurt and may avoid people get confused/annoyed.
This commit is contained in:
parent
84308964e2
commit
f564bf7410
|
@ -104,6 +104,10 @@ module VagrantPlugins
|
|||
included_groups = []
|
||||
|
||||
config.groups.each_pair do |gname, gmembers|
|
||||
# Require that gmembers be an array
|
||||
# (easier to be tolerant and avoid error management of few value)
|
||||
gmembers = [gmembers] if !gmembers.is_a?(Array)
|
||||
|
||||
if gname.end_with?(":children")
|
||||
groups_of_groups[gname] = gmembers
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue