Re: [ansible-project] Variables and serial: keyword

2015-12-11 Thread Brian Coca
yes
no

parameters to serial cannot depend on inventory as it gets read AFTER
the play is evaluated (serial value is assigned). So use extra vars to
set serial dynamically.


-- 
Brian Coca

-- 
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/CAJ5XC8%3DZU2C-ZtytxoTxE8-_Zedx7GFqVxAEtAL4t4j%2BAY5Lgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Variables and serial: keyword

2015-12-11 Thread Eugene Zhulkov
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.