inventory issue

I’m getting the following error:
ERROR! invalid host <host_name> specified for playbook iteration

I have a role that is set to only run against X group of servers that are in an inventory list. The server that is getting the invalid host is not in that sever group so I don’t know why ansible is even trying that host as it is listed in another server group but not the one the role is being applied to.

I’ve never seen this in my 4 years of using ansible. Please help.

It looks like that was fixed some time ago in https://github.com/ansible/ansible/commit/fa368934bd26600104f72f9d8f0591c0fd68e958

Based on a comment in an issue, it’s been fixed since 2.1.1.