Closed BDeus closed 3 years ago
It's a bad practices to derived attributes in default.rb because it's not recompute when you run the chef-client.
It will be a better place to put this code in recipes/_install.rb
version_numbers = node["confluent"]["version"].split(".") archive_version = "#{version_numbers[0]}.#{version_numbers[1]}" default["confluent"]["artifact_url"] = File.join("http://packages.confluent.io/archive", archive_version, "confluent-#{node["confluent"]["version"]}-#{node["confluent"]["scala_version"]}.zip")
See Avoid derived attributes in attribute files in https://github.com/pulseenergy/chef-style-guide#attributes
It's a bad practices to derived attributes in default.rb because it's not recompute when you run the chef-client.
It will be a better place to put this code in recipes/_install.rb
See Avoid derived attributes in attribute files in https://github.com/pulseenergy/chef-style-guide#attributes