-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch mode for delegate_to and local_action (take 2) #2434
Comments
I think I understand now. Right now, the functionality you seek needs to exist in the module itself. I think what you are asking for is exactly how yum and apt work. This can be added to basically any module, but then we also have to teach the module how to work with lists (like apt and yum are told they are special). It would be nice if the module itself could declare this versus the hard code, which is reasonable. What load balancer are you using? (Or just the shell command?) We could teach 'shell' to do "with_items" using the ";" as a seperator, perhaps. |
I think you might be understanding it, just backwards. Switch around which Perhaps I can make it clear with a ridiculous example. Pretend that I work --- - name: Birthday party guests: Joe Jimmy John Susy our_kids kids_from_school tasks: - name: make somthing to eat shell: /home/prepare.sh --food cupcakes --food pizza --for ${guest_name} delegate_to: wife register: food - name: feed the kids action: feed ${food} - name: distribute pins for pin-the-tail-on-the-donkey action: give_pin Here would be a good example of a chance for a special variable and a --- - name: Birthday party guests: Joe Jimmy John Susy our_kids kids_from_school tasks: - name: prepare somthing to eat shell: /home/prepare.sh --food cupcakes --food pizza --for ${everyone_who_is_coming} delegate_to: wife register: food run_once: yes She could use the "everyone_who_is_coming" special variable, and only do the task once. |
This feels like complex_args to me and making a module take a list and knowing what to do with it, but I am closing this because we don't support cupcakes :) |
cheribral, I will be glad to hear if you found a solution for this issue. |
I'll try this again. I had suggested a feature in #2389 which was closed
before I think anyone even understood what the suggestion was. I tried to
clarify what I meant, but it seems like comments to a closed issue go to
/dev/null.
We have roughly 1200 servers which are currently configured with cfengine.
Cfengine is good for determining what to do based on dynamic data, but I have
wanted to find something that can handle group complexity better without
becoming unwieldy or be a resource hog. Obviously, I'm toying around
with ansible, and trying to get it to wrap around a lot of existing stuff.
I have several times wished that delegate_to had an option to do batch
processing instead of firing off for each host in the loop and killing the
delegate server. A batch job is supposedly possible by working around the problem as
described here:
http://jpmens.net/2012/11/03/an-action-plugin-for-ansible-to-handle-ssh-host-keys/
That solution seems less than obvious. As a newbie working through this, the
most intuitive thing I could see would be a "batch=yes" option or something
similar, which would cause delegate_to to run once, and just send the entire
list of hosts ansible is going to loop over.
Anyway, just a suggestion! :)
The text was updated successfully, but these errors were encountered: