Hi @Dima Kovalyov,
The "HOSTGROUP" token syntax is not a general-purpose mechanism for resolving hostnames in the configuration for a Blueprint.
This syntax is generally used in the following scenarios:
1. Exported Blueprints
2. HA-related Blueprints
Outside of these scenarios, the "HOSTGROUP" syntax is not recommended.
The Ambari Blueprints configuration processor will attempt to match HOSTGROUP tokens with hostnames for a specific subset of configuration properties, but this subset of properties is a static list, and is not configurable.
As you mentioned, it is also true that out-of-stack services are not supported by this syntax, for the reason I've listed above.
The "{{ var }}" syntax is not directly supported by the Blueprints processor. There might be cases where a configuration property is pushed down to an ambari-agent that interprets this python-like variable, but this behavior is not guaranteed to work, and should be avoided in Blueprints.
Hope this helps.
Thanks,
Bob