# my_cookbook/recipes/default.rb
root_mysql_connection = {
:host => "localhost",
:username => "root",
:password => node["mysql"]["server_root_password"]
}
# my_cookbook/libraries/my_helper.rb
module MyCookbook
module MyHelper
def self.root_mysql_connection(node)
{
:host => "localhost",
:username => "root",
:password => node["mysql"]["server_root_password"]
}
end
end
end