group name from variable

Hi!
I would like to run a role something like

  • name: debug role
    debug: msg=“{{ hostvars[item].ansible_host }}”
    with_items: groups[ {{ALLOWED_HOSTS_GROUP}} ]

however the syntax groups[ {{ALLOWED_HOSTS_GROUP}} ] is not accepted.
Is there any other way to pass a group name from a variable defined e.g. in a playbook?

Thanks for your support.

with_items: "{{ groups[ALLOWED_HOSTS_GROUP] }}"