clarification of variables in selecting targets

http://www.ansibleworks.com/docs/patterns.html#selecting-targets says:

webservers:!{{excluded}}:&{{required}}

what check is being done? will any host or group with the excluded variable specified or otherwise defined be filtered out? Will running 'ansible-playbook --list-hosts playbook.yml" let me preview the host list?

In testing, I have a group constructed of children groups that I pair with another group with a variable: ‘missing’ set. I’ve tried specifying the variable in the group_vars directory and I’ve tried specifying the variable in the default hosts ini-sytle inventory file, but neither filters out the second groups members with the variable defined.

ini inventory file and playbook (simplified)
https://gist.github.com/davidbirdsong/6664997

should’ve included that I’m on 3.1.0

Yes, --list-hosts should preview the list of hosts for you.

If you want to exclude that host with the variable, you can’t use groupvars because the host line is expanded before host/group variables are read in. Your example playbook works perfectly when you specify the “missing” variable with --extra-vars. Also, in your example, you have {{missing}} in the host pattern, but that is set to the value “1”, so your “hosts:” would expand to “rack_aaaa:!1” (which I’m pretty sure isn’t what you meant). That should be rack_aaaa:!rack_aaaa_missing (no variable) or you should set {{missing}} to a hostname you want excluded.

“will any host or group with the excluded variable specified or otherwise defined be filtered out?”

No.

Filtering is based on the names of the group.