Can group_by add hosts to an existing group?

If you use group_by but the resulting group name already exists in your inventory, what happens? I’d assume the hosts that matched the group_by and weren’t already in the group just get added to the group?

If necessary I don’t mind setting up a few VMs and testing it but I thought I’d see if anyone knew off the top of their head.

Thank you,
Mark

The logic in question is here: https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/action_plugins/group_by.py#L90-L92

“I’d assume the hosts that matched the group_by and weren’t already in the group just get added to the group?”

More like: “the group is added to the host” based on the code

err, ignore that last sentence, you were correct. I’m cross-eyed from looking at code all day

No worries. Thanks for finding that; I’ll have to get more familiar with the source.