I really want better fp support for collections.
With the following, where state defaults to enabled
`
- role: rabbitmq
rabbitmq_plugins:- name: rabbitmq_management
- name: rabbitmq_autocluster_consul
url: https://github.com/aweber/.../rabbitmq_autocluster_consul-0.2.0.ez
state: enabled
`
I want a task like:
`
- name: Enable plugins
rabbitmq_plugin:
names: “{{rabbitmq_plugins.filter(p => p.state is not defined or p.state == ‘enabled’).map(_.name).join(‘,’)}}”
new_only: yes
state: enabled
with_items: rabbitmq_pluginsnotify:
- rabbitmq restart
`
Where of course the expression for ‘names’ is a dream. Its seems so painful to work with collections.
I know can create a template and use a lookup, or create a filter plugin. But it should be easier.
Any nuggets out there from the ansible gurus?