mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
fix 'return false' from parse
this was abandoned early on the manger side but seems like we left behind on plugin side. more flexible extensions with yaml plugin validate data correctly for yaml/constructed fixed issue with only adding one child to keyed, the group only got the host that forced it's creation fixes #31382 fixes #31365
This commit is contained in:
@@ -142,10 +142,13 @@ class BaseInventoryPlugin(object):
|
||||
continue
|
||||
if isinstance(groups, string_types):
|
||||
groups = [groups]
|
||||
for group_name in groups:
|
||||
if group_name not in self.inventory.groups:
|
||||
self.inventory.add_group(group_name)
|
||||
if isinstance(groups, list):
|
||||
for group_name in groups:
|
||||
if group_name not in self.inventory.groups:
|
||||
self.inventory.add_group(group_name)
|
||||
self.inventory.add_child(group_name, host)
|
||||
else:
|
||||
raise AnsibleOptionsError("Invalid group name format, expected string or list of strings, got: %s" % type(groups))
|
||||
else:
|
||||
raise AnsibleOptionsError("No key supplied, invalid entry")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user