Using Global Variables in YAML config

I’m having a little trouble working with the Global Variables in Foreman. I have a global variable called ALLOW_AD_USERS which I can see in the facts section against the host. I’m trying to use this variable with in the YAML config associated with a host. It just seemed to copy this in like-for-like.

After reading the manual, I would have thought I could add "${$foreman::ALLOW_AD_USERS}" and it auto file the names I have defined within the global variable.

Any help would be great here.

sssd:
  domains: example.com
  config_file_version: 2
  services:
  - nss
  - pam
domain/example.com
  ad_domain: example.com
  krb5_realm: EXAMPLE.COM
  realmd_tags: manages-system joined-with-adcli
  cache_credentials: true
  id_provider: ad
  access_provider: simple
  simple_allow_users:
  - "${$foreman::ALLOW_AD_USERS}"
  ignore_group_members: true
  dyndns_update: true
  ad_gpo_map_permit: "+polkit-1"

After finding: Smart Variables in Config Templates

… I have managed to get limited success from using the following config:

  ...access_provider: simple
  simple_allow_users:
  <%=@host.params['ALLOW_AD_USERS'] %>
  ignore_group_members: true...

I’m unsure whether there is a better approach here, I would have thought there was way of leveraging the arrays or YAML types. For now, the global variable is a string type and the usernames are listed with an indent like so:

   - user1
   - user2

I’m still a little unsure whether this maps well with the YAML tab found, I can’t quite see the link clearly. There is however more information in the help section when you create a custom report in Monitor > Report Template. This might shine a light on how to access some of the other variables in the smart classes.

Correction, the config line needed outdenting so the indented variable work.