Chef does not read attributes and definitions

I have an old project that I built with a chef ( https://github.com/noha/virtual-gemstone ). He uses a chef along with a tramp to achieve his goal. The project has been obsolete over the past few months, and now I want to reactivate it. But I was not very lucky with his chef 11. No matter what I try to use in the /default.rb attributes, they are not there. In the gemstone / attributes / default.rb file, I have

default[:gemstone][:base_url] = "http://glass-downloads.gemstone.com/gss24" default[:gemstone][:version] = "GemStone64Bit2.4.4.1-x86_64.Linux" default[:gemstone][:dir] = "/opt/gemstone" default[:gemstone][:log_dir] = "/opt/gemstone/log" default[:gemstone][:lock_dir] = "/opt/gemstone/locks" default[:gemstone][:user] = "gemstone" default[:gemstone][:no_gems] = 3 default[:gemstone][:low_port] = 7000 default[:gemstone][:cache_path] = Chef::Config[:file_cache_path] 

and in gemstone / recipes / base.rb I have

 ... tmp = node[:gemstone][:cache_path] base_url = "#{node[:gemstone][:base_url]}" file = "#{node[:gemstone][:version]}.zip" dir = "#{node[:gemstone][:dir]}/#{node[:gemstone][:version]}" ... 

but the values ​​are always undefined / empty. I even tried to set node.default in the attributes file, and also when accessing the values ​​in the recipe.

To verify this, I copied all the .rb files of the recipe into a single default.rb file and added the contents from the attributes file. This works, but it does not complain about the missing function that I defined in gemstone / definitions / monit.rb called monit_gem.

The whole project worked a few months ago. Therefore, I think that in my current setting for the chef there is something fundamentally wrong. But I could not find much that needed to be configured for this to work normally.

What could be the reason that the attribute and definition files are not read by the chef?

+4
source share
1 answer

I got it using the help from the opscode list. If include_recipe is used in recipes, you must include the dependency operator in metadata.rb for the included recipe. Otherwise, attributes, definitions, etc. They are not readable and therefore they are not available inside the recipe.

+14
source

Source: https://habr.com/ru/post/1489917/


All Articles