# setup module slow when connecting to host with ohai installed

**URL:** <https://forum.ansible.com/t/setup-module-slow-when-connecting-to-host-with-ohai-installed/14776>\
**Category:** Ansible Project\
**Created:** [March 14, 2014, 6:00pm UTC](https://forum.ansible.com/t/setup-module-slow-when-connecting-to-host-with-ohai-installed/14776 "2014-03-14T18:00:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Leggett](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Peter\_Leggett](https://forum.ansible.com/u/Peter_Leggett)\
**Post date:** [March 14, 2014, 6:00pm UTC](https://forum.ansible.com/t/setup-module-slow-when-connecting-to-host-with-ohai-installed/14776/1 "2014-03-14T18:00:42Z")

</div>

Hi,

caveat - new to ansible.

I have a host that just happens to have chef client installed and is also authenticating to an LDAP with 38,000 users in it.  
When I run

$ ansible -m setup -i hosts hostname

it takes a very login time to return, because the ansible setup module is finding ohai on the host and that is returning every user in the LDAP.  
☹

This problem exists for chef server as well but the chef server allows for disabling the ohai passwd plugin.  
Ohai documentation tells me it is not possible to disable in this way when run directly on the client host.  
Looking at the ansible setup module python code, it looks like there is no way to say “don’t use ohai even if present”.

Am I missing something, is there an easy way around this problem with ansible, apart from removing the chef-client ?

Thanks,

Pete

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 17, 2014, 1:54pm UTC](https://forum.ansible.com/t/setup-module-slow-when-connecting-to-host-with-ohai-installed/14776/2 "2014-03-17T13:54:54Z")

</div>

This is true that Ansible will use ohai if installed and doesn’t auto-remove it.

Your workaround right now would be to uninstall ohai.

I’ve pondered removing the facter/ohai integration in the past, though it can be useful to help users migrating from other tools or having to still work with them in some places.

It does seem sad that it would automatically assume we’d want every user in LDAP, and this may warrant the idea that this should be configurable. Perhaps we could have the setup system pass a “use\_legacy\_facts” parameter down and have this configurable in ansible.cfg (default off)?

If this is something someone would like to work on, that would be a welcome addition and probably not terribly difficult.

Uninstalling ohai of course will definitely fix the problem 🙂

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [March 17, 2014, 4:42pm UTC](https://forum.ansible.com/t/setup-module-slow-when-connecting-to-host-with-ohai-installed/14776/3 "2014-03-17T16:42:30Z")

</div>

add ignore\_ohai and ignore\_facter =true (default false) to setup module and ansible.cfg?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 17, 2014, 4:55pm UTC](https://forum.ansible.com/t/setup-module-slow-when-connecting-to-host-with-ohai-installed/14776/4 "2014-03-17T16:55:07Z")

</div>

How about: default:

fact\_gathering=core,ohai,facter

?

That way it’s more pluggable-ish

---

<div class="post-metadata">

**Author:** ![kesten\_broughton1](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@kesten\_broughton1](https://forum.ansible.com/u/kesten_broughton1)\
**Post date:** [August 26, 2014, 6:43pm UTC](https://forum.ansible.com/t/setup-module-slow-when-connecting-to-host-with-ohai-installed/14776/5 "2014-08-26T18:43:43Z")

</div>

Did this ever make it into trunk?

I’ve hit a case where I’d like to be able to disable the automatic ohai fact-gathering.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 26, 2014, 10:58pm UTC](https://forum.ansible.com/t/setup-module-slow-when-connecting-to-host-with-ohai-installed/14776/6 "2014-08-26T22:58:33Z")

</div>

Looks like no.

You could uninstall ohai 🙂
