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_plugins

  notify:
    - 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? 


 


-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/016d9a8c-044c-4405-a2ac-3f19e68142ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to