I am trying to create a smart inventory based upon the following:
I have a hosts file in INI format with two groups specified as:
[internal:children]
group1
group2
[dmz:children]
group3
group4
I want to use these groups as a smart inventory each, but if I use the name “internal” or “dmz” in the advanced filter as groups__name it does not look up any hosts of the subgroups. How can I achieve this?
Smart inventories are being deprecated in favor of the new constructed inventory type. I’d recommend trying to utilize that for more advanced query options.
thanks for your quick response. Actually I dont see, how a constructed inventory can replace a smart inventory.
With smart inventory I can build smaller sub-inventories with for example only NFS or FTP servers in it, based on the groups in my inventory. I have to use groups, because the hostnames unfortunately do not match their function.
With constructed inventories it seems like they always import all hosts and groups found in the inventory file and just can build further groups based on rules. Thats nice, but groups are not visible / selectable in the Template dialog. So the user needs to know the group names or has to find out before he launches a Template. With the smart inventories its much easier, because the user can select one of them directly in the dialog.
You can then limit for ‘az_linux_eastwestus2_patchwave2’
Disadvantage with constructed inventories, at the moment it will duplicate every host that matches, by creating a new host in this new constructed inventory. Even in the same organisation.