Try the below suggestions
On Wed, 26 Jan 2022 at 15:29, Roshani <[email protected]> wrote:
> vars:
> proj: 'website'
> subproj: 'front'
> tasks:
> - name: "Show group members"
> debug: msg=?? # Something like:
> {{groups[{{proj}}-{{subproj}}-lb]}}
debug: var=groups[proj]~'-'~subproj~'-lb']
> - name: "Conditional"
> do something
> when: inventory_hostname in {{groups[{{proj}}-{{subproj}}-lb]}}
when: "inventory_hostname in groups[proj ~ '-' ~ subproj ~ '-lb' ]"
--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT
--
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/CAL8fbwMY%3DU5HdJV2FJFFKVjpPCq52axYryEoYdg_yWnYhPAsvg%40mail.gmail.com.