custom filter used in aggregate doesn't receive the correct list.

Hello

I’m trying to use aggregates to speed up configuration of my Nexus switches.

I’m using a custom filter to generate a customized list of interfaces based on a “interfaces” list, defined in the group_vars and host_vars files (some of the resources defined in each of them).

But my filter, called with aggregate: “{{ interfaces | pc_params }}” Only receives the host_vars list, not the aggregated one of group_vars interfaces list and host_vars interfaces list, as it was supposed to do.

In resume: M filter only receives the list defined in the host_vars, without the group_vars contents. This is incorrect and I don’t know if I’m doing something wrong or is a bug. (using ansible 2.8 BTW)

Related information

Currently I have (excerpts):

inventory.yml

OK, I discovered it. The merge feature only works AFAIK with dictionaries. So I changed my interface list to a dictionary and the call to the filter with:

aggregate: “{{ interfaces | dict2items | if_params }}”

so I get the merged dictionary, convert to a list and pass to my filter.

It works this way.