Is it possible to access hostgroup membership as a parameter?

Hi all

I'm new here and wanted to ask something fundamental to my thoughts on
using foreman.

I want to be able to expose a list of hosts that are members of a hostgroup
to other some other hosts - for example, to allow connection to a database,
I might want the database server to know what webservers are in the
hostgroup for a certain application and limit access by those nodes ip
address or other detail. Is this possible?

Regards
Martyn