简体   繁体   English

禁用ohai插件

[英]Disable ohai plugin

Using oahi version 8.0.0 from the chefdk on mac. 在Mac上使用来自Chefdk的oahi版本8.0.0。

If I run the command ohai in the terminal, my mac completely locks up for 10+ minutes). 如果我在终端中运行命令ohai ,则我的Mac会完全锁定10分钟以上)。

Users have suggested this is caused by being connected to LDAP and recomend disabling the passwd.rb plugin. 用户建议这是由于连接到LDAP并建议禁用passwd.rb插件引起的。 Where is that file located and how do I disable it? 该文件在哪里,如何禁用它?

https://github.com/chef/ohai/issues/1165 https://github.com/chef/ohai/issues/1165

Put the following inside /etc/chef/client.rb 将以下内容放入/etc/chef/client.rb

ohai.disabled_plugins = [:Passwd]

Or if using ohai 7 or newer 或者如果使用ohai 7或更高版本

Ohai::Config[:disabled_plugins] = [ :Passwd ]

Or point chef-shell to a specific config file 或将chef-shell指向特定的配置文件

chef-shell -c ~/foo.rb

OSX users will need to make the /etc/chef/ directory since it doesn't exist by default OSX用户将需要创建/etc/chef/目录,因为默认情况下该目录不存在

sudo mkdir /etc/chef
echo 'ohai.disabled_plugins = [:Passwd]' | sudo tee -a /etc/chef/client.rb

(Previous version of this SO answer showed that you could rename the passwd.rb plugin, that is no longer recommended since it breaks newer versions of chef) (此SO答案的先前版本显示您可以重命名passwd.rb插件,由于它破坏了较新版本的Chef,因此不再建议使用该插件)

I actually just ran into this, but there was another passwd.rb in the gems directory that needed renamed as well. 我实际上只是遇到了这个问题,但是gems目录中还有另一个passwd.rb也需要重命名。 Running this command found and moved all of them for me so I could move on with my Chef travels: 运行此命令发现并为我移动了所有命令,这样我就可以继续进行厨师旅行:

sudo find /opt/chefdk/embedded/ -wholename *ohai* -name passwd.rb -exec mv {} {}.bad \;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM