Access usergroups in template

Problem:
I am trying to access a usergroup different from @host.owner in a userdata template. Unfortunately none of the functions used in create_users snippet are documented anywhere.

I do not want to use host.owner because that means we have to set host.owner somehow. Does the default owner get set for discovered host? Otherwise this would be a manual step and too fragile. As such I would just like to be able to set a group name in a host parameter and then get all users that way. Example:

host_param(‘login-users’).all_users

Pointers to any documentation about host parameters, and methods such as ‘all_users’, parameters of user classes, etc. would also be nice, as I could not find it anywhere. I suspect it might be this: https://www.rubydoc.info/github/theforeman/foreman/ ? But then it is not documented which of these are accessible, in which way, in templates.

Foreman and Proxy versions:
1.19.1