Dynamic inventory reporting fewer groups than previous versions

Problem: Ansible not reporting organization or location as a group.

Expected outcome: The org and location a host belongs to are reported in groups and group_names as foreman_[name].

Foreman and Proxy versions: 3.6.1

Foreman and Proxy plugin versions: Katello 4.8.3

Distribution and version: EL8

Other relevant data:


  • Foreman 3.6
  • theforeman.foreman [3.8, 3.12]
  • Ansible 2.14.x

This seems to be occurring after upgrading from Foreman 3.5. Previously a host would have the Foreman location and organization show up as groups for a host along with any other hostgroups, collections, etc. I am using those values in multiple areas of my Ansible workflows for site-conditional logic.

This is not a blocker by any means, as there is the foreman_location_name host variable, I was just surprised to see the location disappear from the reported Ansible groups. I didn’t see any note around this in Foreman’s or the collection’s changelogs, nor did the inventory plugin’s code throw any immediate red flags.

For the inventory’s configuration, I have tested with wants_location: true specified to ensure it was at least forced (though the code/docs say it’s enabled by default).

If anyone finds this thread via a search engine, the discussion moved to [inventory] Location group not generated when "want_location" is specified · Issue #1657 · theforeman/foreman-ansible-modules · GitHub

1 Like