BUT how I would create them is different.
I would like to have a file where I have
entity id - group (commas separated, taml, csv, any format is ok) and read all the lines to add the correct entity to the correct group
the question is: how can I read such file?
In the linked example, replace the entities template with an !include that points to a file containing the group’s members (name the file whatever you want).