Sorry I didn't reply earlier, I hoped for other people having a use case
here too :)
group_children['market-za'] = ['front-za', 'backend-za']
group_children['front-za'] =
This sounds good to me. I'd add a var for parent groups to that, too, as
this is also available in the Group object.
Given hosts have a 'group_names' containing all groups (upwards
recursively) it is a member of, it might also makes sense here to have a
var containing only the direct parents.
So:
- group_children has keys for every group
- group_parents has keys for every group
- group_names and group_names_parents would exist for every host, the
former alreqady exists.
Given this, a word on a related use case that is covered by the same
subject, and in which I have an interest.
I would like to be able to more easily target multiple sets of clusters
within the same playbook in a serialized way, e.g. applying the same role
to deploy different apps.
Given say 100 tomcat clusters, deployed with 1 set of roles in the same
way, but with different apps, parametrized via the inventory, I need to
deploy one node at a time.
Now, this is possible with serial: 1 of course, but when a deploy consists
of upgrading several related application, it would be a big benefit to be
able to deploy several clusters at the same time, but each node within a
given cluster 1 at a time.
So, functionally, that would be something like "serial: per node in
cluster".
Code wise, this would translate into runner using serial batches, where the
first batch contains 'all the first nodes in the cluster', the next batch
all second nodes, and so on.
I'm not sure ho wthis could be easily defined though. Given all nodes of a
paticular cluster are part of a particular application group, and those
application groups would be part of, say, a tomcat group,
parent/grandparent group membership could be looked at, but so far I
couldn't think of a decent way to model that.
Thoughts?
Serge