mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Merge pull request #4571 from tgerla/whitespace
add_group module: strip trailing/leading whitespace from comma-separated group names
This commit is contained in:
commit
b0f6e77f66
1 changed files with 1 additions and 0 deletions
|
@ -79,6 +79,7 @@ class ActionModule(object):
|
||||||
# add it to the group if that was specified
|
# add it to the group if that was specified
|
||||||
if groupnames != '':
|
if groupnames != '':
|
||||||
for group_name in groupnames.split(","):
|
for group_name in groupnames.split(","):
|
||||||
|
group_name = group_name.strip()
|
||||||
if not inventory.get_group(group_name):
|
if not inventory.get_group(group_name):
|
||||||
new_group = Group(group_name)
|
new_group = Group(group_name)
|
||||||
inventory.add_group(new_group)
|
inventory.add_group(new_group)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue