Dynamic and smart inventories

Hello,

I have Dynamic inventory populated by inventory script.
The hosts in this inventory are Windows machines and related connection variables are set on all group level.
There are also child groups.
This part works perfectly.

Then I create Smart inventory based on hosts group membership and host name patterns.
The variables set on all group level are no longer applied to the hosts in smart inventory and so I have to set them in Smart Inventory again.

Is it expected behavior?
Should not Smart Inventory inherit somehow variables set on groups level of original inventory since Smart Inventory contains the same hosts as original inventory and vars from original inventory are still valid and required in Smart one?

P.S. I can set connection variables on every host level in my inventory script, but this will cause a lot of duplicated data.

Thank you,

  • Igor

Expected behavior. Only host-vars remain in smart Inventories.

You can set Inventory-level variables on the smart inventory that will, effectively, be applied to all hosts in your smart inventory.