setup module slow when connecting to host with ohai installed

270 views
Skip to first unread message

pfl666

unread,
Mar 14, 2014, 2:00:42 PM3/14/14
to ansible...@googlegroups.com

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



Michael DeHaan

unread,
Mar 17, 2014, 9:54:54 AM3/17/14
to ansible...@googlegroups.com
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 :)





--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e6bffefa-bb35-4a08-b98f-eda6653fbad9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Coca

unread,
Mar 17, 2014, 12:42:30 PM3/17/14
to ansible...@googlegroups.com
add ignore_ohai   and ignore_facter =true (default false) to setup module and ansible.cfg?

Michael DeHaan

unread,
Mar 17, 2014, 12:55:07 PM3/17/14
to ansible...@googlegroups.com
How about:  default:

fact_gathering=core,ohai,facter

?

That way it's more pluggable-ish




On Mon, Mar 17, 2014 at 12:42 PM, Brian Coca <bria...@gmail.com> wrote:
add ignore_ohai   and ignore_facter =true (default false) to setup module and ansible.cfg?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

kesten broughton

unread,
Aug 26, 2014, 2:43:43 PM8/26/14
to ansible...@googlegroups.com
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.

Michael DeHaan

unread,
Aug 26, 2014, 6:58:36 PM8/26/14
to ansible...@googlegroups.com
Looks like no.

You could uninstall ohai :)



Reply all
Reply to author
Forward
0 new messages