Foreman hosts group

Good afternoon, please tell me if it is possible to somehow force the host to assign a group automatically when it is included in the foreman service? Now the host comes to Foreman, connects to the correct environment, but does not receive any group.

Expected outcome:
the host group is assigned automatically depending on the selected puppet environment
Foreman and Proxy versions:

Foreman and Proxy plugin versions:
Distribution and version:
Other relevant data:

You can set a custom fact foreman_hostgroup on the host and it will be assigned to that hostgroup when reporting in.
Another option would be to use the Default Hostgroup plugin to define more complex logic.

and how can this be done on the host?

Take a look at the puppet documentation regarding custom facts:

is it possible to somehow specify a host group in puppet. conf on the host, the same way I do it to assign the environment???

  • * there is also a question of how you can automatically assign an organization and location to a host.?