Mike,
Thanks for the reply.
Subtractive Matching, as you called it may seem not quite normal in ansible. We have large clusters of hundreds of compute nodes. It is quite normal for us to run pdsh or ansible against all nodes to do a million things across the board. But. sometimes we just want to do a command against some of the nodes, Sometimes, those nodes are in a structured mode so a "list" of say all compute nodes in rack3 and rack4 would be a good way to talk to just those nodes. However, we find that other than a list of all nodes in the cluster, and maybe some lists of subsets, say all the nodes with one processor type versus another processor. Or a list of all nodes in each chassis or rack is all that we want to manage.
However, there a a lot of times we need to hunt down which nodes are running, say a program that is spread out over a dozen nodes in the cluster, then we want to run a command specifically on those nodes. It is not practical to have lists of every combination of these clusters with 200 or 500 individual compute nodes. Much easier to say run on nodes a, k and r this command.
Likewise, if we want to run a command that could be disruptive to a running job on a set of nodes, we want to run a command on all nodes, but not on those nodes a, k and r. You see.
Actually, even with pdsh, at first I made subgroup hosts lists for each rack or chassis, but found it just as easy to say "pdsh -w node[1-64,81-128,161-192] <command>" to skip the 5th, 8th and 9th chassis (each with 16 nodes in them) then to use the sublist of hosts groups for the chassis. Of course, could do the same with "pdsh -x node[65-80,129-160} <command>" and let it run the command on All servers in this cluster, using the default list of all nodes, but exclude those nodes in those three chassis. And yes this could be done with a pdsh with the exclude the three subgroups that represent those three chassis.
But, truth be know, it is rear that a command needs to be run on all blades in certain chassis. More likely it is needed to run on a spattering of nodes all over the entire cluster....Or run on all node EXCEPT a spattering of nodes all over the cluster.
That is why I was wondering if there was an exclude option with ansible. If not, we have the method you wrote about.
Thanks