Ohai omit or overwrite specific attributes


#1

Hi there

Client: chef-12.7.2
Server: chef-server-core-12.11.1

I ran into problem “413 Request entity too large”. You can read on-line that it’s a problem with nginx and you should adjust client_max_body_size in nginx but it’s 250M by default so I don’t think it’s the problem. The output that chef wants to save is roughly 1.5M (chef-client -ldebug show what it wants to save).

As I’m reading here https://github.com/chef/chef-rfc/blob/master/rfc045-node_state_separation.md there’s a limit of 1MB which makes sense. The only host I’m experiencing this problem is a machine where I have over 700 nfs shares mounted which is the cause of such a unusually “big” output to be saved back to chef-server.

Is it possible to disable collecting by ohai nfs shares (only nfs shares)? This way produced .json wouldn’t be as big as it is now. I don’t need information about nfs shares so I just want to get rid of it and make chef run successful.

Also I read one can disable specific plugins i.e Filesystem plugin but it seems it doesn’t work in standard configuration as it’s stated here https://docs.chef.io/ohai.html#ohai-resource

The Ohai executable ignores settings in the client.rb file when Ohai is run independently of the chef-client.

Any help would be appreciated.


#2

This only refers to when you run ohai directly on the command line, as opposed to when Chef Client invokes ohai internally. So disabling the plugin via the Chef Client configuration is probably your best bet.


#3

In /etc/chef/client.rb

ohai.disabled_plugins = [
:filesystem,
]

Sadly I don’t see any message about disabling the plugin and chef-clients still tries to upload a huge json to chef-server.


#4

Ohai plugins are case sensitive and since Ohai 7 the plugins are all capitalized.

That should do the trick.


#5

I’ve already tried it. It doesn’t work either. Thanks for the suggestion.