How to filter dictionary entries using Jinja

Dear all,

I'm at a loss as to how to filter entries fom a dictionry based von specific host variables. In the concrete case we have a long list of possible NFS mounts which should be applied according to the hosts' class.

Our hostlist would be like:

host1 class=cluster
host2 class=cluster
host3 class=server

our dictionary of possible mounts would e.g. be:

If each mount was managed by a role, you could just apply those
roles to the (groups holding) the relevant servers.

You'll need to have multiple data structures, one per role, but that's
probably going to 'work with the grain' of Ansible better.

when: class in item.value.class

I haven't used roles yet. If a host can assume several roles, then this could work. Otherwise I'll have to deal with redundant dictionaries, which is exactly what I want to avoid.

Thanks for the hint

frank

Wow, so simple? :slight_smile: Thanks a lot.
frank