Add ability to use Ansible groups in generated inventory. Fixes #2551.