In 2.0, when is the inventory read and the special "groups" variable populated?

Our playbooks set facts similar to

  • name: illustrate problem
    set_fact:
    monitoringServer: “{{ groups.nagios.0 }}”

In 1.9.x that would evaluate to the first server in the nagios group in inventory
In 2.0, groups doesn’t contain a value for nagios, or any other inventory group. It only contains “all” and “ungrouped”, both of which contain localhost.

That should only happen if you are using no inventory, the internal
fallback is to create a 'localhost' entry which defaults to those
groups.

Thanks for the tip. Some code that managed .ansible.cfg was misbehaving and changing the default inventory file unexpectedly.