On Sunday, October 5, 2014 12:02:21 PM UTC-6, Michael DeHaan wrote:
>
> What you have above, say if you had 500 hosts, would run each step 500 
> times and likely overwhelm that server.
>
>
actually that is the intent. My example was "simplified" so it's easy to 
understand mechanics of it, but obviously it's hard to explain reasoning 
for doing it so. In other words instead of "hostname" there's a command 
that does some "central registration" of each host, and it has to run from 
a central place. However in certain cases I can bypass that. 

if I'm reading your comment correctly you propose to do:

- hosts: central_server
  tasks:
  - name: register other hosts
    shell: echo "{{ item }}" >> /tmp/registry
    with_items: groups.X
 
however that disrupts the flow of the playbook and make my loops bit more 
complicated (for example where originally I'd have "with_items" loop 
iterating over items to be applied to the host I now have to implement more 
complicated constructs like "with_nested" etc.). 

Also moving it out like that makes role not self-sufficient - i.e. if I 
want to recycle my role, I have to use the role that iterates over servers 
in a specified group or all. 

-- 
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/d55963c9-9cfb-4ef3-bad9-78bc039280ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to