I've been struggling with passing variable to serial for the whole day.

All I need is to pass group's length, I've tried 
serial: "{{ groups['appserver']|length }}"

and got a runtime error.

Finally I come up with this code: 
serial: "{{ lookup('group_size', 'appserver') }}"

, where *group_size* is a custom lookup plugin. 

Now I have another problem - how can I get access to inventory instance 
inside lookup plugin? I don't understand API design - all plugins have 
"runner" instance in constructor except LookupModule. 

So my questions are:
- can I parameterize serial?
- can I access inventory inside LookupModule?

Thank you! 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ec93b5ba-fef0-4a8d-b895-3f1b26980168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to