Just a (dumb?) idea ...
Not sure it would be more elegant but having ansible-playbook calling
ansible-playbook ....
That is the top level playbook do all the inventory stuff to calculate
cell1, cell2 , .. as host groups
and then having a loop task that call ansible-playbook (via shell
command) from the local_host doing
the effective work and passing the {{ current_cell }} as a set of host
for a play in the second level playbook
so a way to simulate a loop over a play (the host mapping layer) with
the capability to change the play
parameters (hosts in your case)
Not sure Michael would like to see this being materialized as a
'playbook' module :-)
my half cent.
--Phil
2014/1/22 Jesse Keating <[email protected]>:
> Here's a fun scenario.
>
> Our inventory is divided up into multiple environments, that is when we
> execute our inventory plugin, we provide an ENV_NAME environment variable to
> tell the plugin which environment to load.
>
> Within each environment there are a number of logical groupings, we'll call
> these "cells". Each environment has 1 or more cell, and they get added
> semi-frequently so there isn't necessarily a hard coded list of them
> (although it is discoverable at run-time). My inventory plugin creates a
> group for each of those cells, that has other child-groups within.
>
> My need is to run a couple tasks. A torrent task and a stop torrent task.
> These tasks need to run in parallel within the cell, but serially through
> the list of cells. That is I have to torrent and then stop torrenting in
> cell1 before doing anything in cell2, and then cell3, etc...
>
> I'm looking for ways to express this in a playbook and falling short. I know
> I could use a shell script to loop over calling ansible-playbook providing a
> different --limit value each time but that feels inelegant.
>
> So I ask you, fellow Ansible users, do you have any ideas?
>
> -jlk
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
--
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].
For more options, visit https://groups.google.com/groups/opt_out.