[Solved] Chef Apache2 recipe failing during server build


With OHAI 7, you don’t need (and can’t) reload plugins on the basis of the filename where the specific function is provided. Instead, you reload it based on the specific attribute you want to reload.

Thus, while the attributes in node['etc']['passwd'] still are provided by a plugin named passwd.rb, you can’t reload it that way. Instead, you want to reload the data in node['etc'], regardless from which files it is filled.

You can reload the password data by using this code in your recipe:

ohai "reload_users" do
  plugin "etc"
  action :reload
end

This is taken from the documentation at https://docs.getchef.com/ohai.html#id3.

solved Chef Apache2 recipe failing during server build