ansible/ansible — pull request #3271 by trbs (2013-06-19 21:55:51+00:00)
Title: add is_in_inventory filter

This filter can be used to check if a given hostname, groupname or list thereof is in the currently running inventory.

It returned a boolean indicating whether or not it matched.

There are potentially many use cases for this.

I use it in combination with roles to be able to have vars that limit or expand some configuration based on which server or servergroup it's running on.