# ANSIBLE\_INVENTORY\_ENABLED not picking up values

**URL:** <https://forum.ansible.com/t/ansible-inventory-enabled-not-picking-up-values/25531>\
**Category:** Ansible Project\
**Created:** [September 19, 2017, 7:40pm UTC](https://forum.ansible.com/t/ansible-inventory-enabled-not-picking-up-values/25531 "2017-09-19T19:40:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![senorsmile](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/senorsmile/32/9024_2.png) [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Post date:** [September 19, 2017, 7:40pm UTC](https://forum.ansible.com/t/ansible-inventory-enabled-not-picking-up-values/25531/1 "2017-09-19T19:40:02Z")

</div>

As specified here:

[https://github.com/ansible/ansible/issues/25321](https://github.com/ansible/ansible/issues/25321)

we must now specify the inventory type, making yaml based inventory a higher precedence.

I found the new cli env vars here:  
[https://github.com/ansible/ansible/blob/stable-2.4/lib/ansible/config/base.yml](https://github.com/ansible/ansible/blob/stable-2.4/lib/ansible/config/base.yml)

I’m trying to override this via the env var to no avail:

`  
ANSIBLE\_INVENTORY\_ENABLED=‘script,yaml,ini’ ansible web1 -i inventory/ -m raw -a uptime

`

If I put garbage in there, it shows that it’s loading them though:

`  
ANSIBLE\_INVENTORY\_ENABLED=‘[a,i,o]’ ansible web1 -i inventory/ -m raw -a uptime

`

---

<div class="post-metadata">

**Author:** ![senorsmile](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/senorsmile/32/9024_2.png) [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Post date:** [September 19, 2017, 8:03pm UTC](https://forum.ansible.com/t/ansible-inventory-enabled-not-picking-up-values/25531/2 "2017-09-19T20:03:12Z")

</div>

The ansible.cfg doesn’t seem to be working either.

I added the following to ansible.cfg

`  
enable\_plugins = ‘host\_list’, ‘script’, ‘yaml’

`

and now I see these errors:

`  
ansible all -i inventory/ --list-hosts

`

---

<div class="post-metadata">

**Author:** ![senorsmile](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/senorsmile/32/9024_2.png) [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Post date:** [September 19, 2017, 8:06pm UTC](https://forum.ansible.com/t/ansible-inventory-enabled-not-picking-up-values/25531/3 "2017-09-19T20:06:03Z")

</div>

The items should NOT have quotes around them.

Now I get the same as setting the env var from the cli:

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 19, 2017, 9:09pm UTC](https://forum.ansible.com/t/ansible-inventory-enabled-not-picking-up-values/25531/4 "2017-09-19T21:09:02Z")

</div>

could you run with -vvv and/or ANSIBLE\_DEBUG=1?

---

<div class="post-metadata">

**Author:** ![senorsmile](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/senorsmile/32/9024_2.png) [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Post date:** [September 19, 2017, 9:32pm UTC](https://forum.ansible.com/t/ansible-inventory-enabled-not-picking-up-values/25531/5 "2017-09-19T21:32:04Z")

</div>

Running:

ansible all -i inventory/backend/nodes.yml --list-hosts -vvv

> ansible 2.4.0.0
> 
> config file = /Users/shaun/Seafile/scripts/ansible/yaml\_inventory/ansible.cfg
> 
> configured module search path = [‘/Users/shaun/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
> 
> ansible python module location = /Users/shaun/Gentoo/usr/lib/python3.5/site-packages/ansible
> 
> executable location = /Users/shaun/Gentoo/usr/lib/python-exec/python3.5/ansible
> 
> python version = 3.5.2 (default, Sep 1 2017, 08:53:54) [GCC 4.2.1 Compatible Clang 3.9.1 (tags/RELEASE\_391/final)]
> 
> Using /Users/shaun/Seafile/scripts/ansible/yaml\_inventory/ansible.cfg as config file
> 
> [WARNING]: Unable to parse
> 
> /Users/shaun/Seafile/scripts/ansible/yaml\_inventory/inventory/backend/nodes.yml as an inventory source
> 
> [WARNING]: No inventory was parsed, only implicit localhost is available
> 
> [WARNING]: Could not match supplied host pattern, ignoring: all
> 
> [WARNING]: provided hosts list is empty, only localhost is available
> 
> [WARNING]: No hosts matched, nothing to do
> 
> hosts (0):

That’s interesting… it’s using python3.5.

I created a virtualenv for ansible 2.4 and everything works.

It seems that my environment with a default python3.5 (technically a gentoo prefix on Mac) is actually using python3. That doesn’t happen in the gentoo prefix for Ansible 2.3.2.

The virtualenv works though, so problem solved for me… not sure if there is in fact a larger issue here though.
