# Dynamic and smart inventories

**URL:** <https://forum.ansible.com/t/dynamic-and-smart-inventories/29723>\
**Category:** AWX Project\
**Tags:** windows\
**Created:** [February 20, 2019, 5:19pm UTC](https://forum.ansible.com/t/dynamic-and-smart-inventories/29723 "2019-02-20T17:19:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor\_Turovsky](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@Igor\_Turovsky](https://forum.ansible.com/u/Igor_Turovsky)\
**Post date:** [February 20, 2019, 5:19pm UTC](https://forum.ansible.com/t/dynamic-and-smart-inventories/29723/1 "2019-02-20T17:19:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christopher\_Meyers](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Christopher\_Meyers](https://forum.ansible.com/u/Christopher_Meyers)\
**Post date:** [February 20, 2019, 6:00pm UTC](https://forum.ansible.com/t/dynamic-and-smart-inventories/29723/2 "2019-02-20T18:00:50Z")

</div>

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.
