> > > Hi! Does anyone know if there's a variable set for the target group of a > > > play? > > > For example, for this: > > > - hosts: *prime* > > > roles: > > > - nginx > > > - postfix > > > Does any variable get set to "prime" in a deterministic way?
> > No. There is no such "special variable" > > https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html > > > > ... variable "groups" > > > > "A dictionary/map with all the groups in inventory and each group > > has the list of hosts that belong to it" > > ... > > Do you have any use-case which needs such variable? > Yes. I would like to have common roles, e.g. httpd, that could be > "app-aware" based on the target group. What do you mean by "'app-aware' role based on the target group"? -- Vladimir Botka -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20201201224001.78b51158%40gmail.com.
pgpmUVWqatW4N.pgp
Description: OpenPGP digital signature
