Open ml185202 opened 6 years ago
Now that Chef Client 12 is EOL, the cookbook needs to be updated to use the newer versions, 13 & 14.
This is the error we are seeing
undefined method `platform_version' for #
/var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb:26:in from_file' /var/chef/cache/cookbooks/mongodb3/recipes/default.rb:20:infrom_file' /var/chef/cache/cookbooks/dc_dr_mongodb/recipes/install.rb:17:in from_file' /var/chef/cache/cookbooks/dc_dr_mongodb/recipes/default.rb:5:infrom_file'
from_file' /var/chef/cache/cookbooks/mongodb3/recipes/default.rb:20:in
from_file' /var/chef/cache/cookbooks/dc_dr_mongodb/recipes/default.rb:5:in
/var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb:
19: 20: pkg_major_version = node['mongodb3']['version'].to_f # eg. 3.0, 3.2 21: 22: # Setup default package version attribute to install 23: pkg_version = node['mongodb3']['version'] 24: case node['platform_family'] 25: when 'rhel', 'fedora' 26>> pkg_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019 27: if node['platform'] == 'amazon' 28: pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019 29: end 30: end 31: 32: # Setup default package repo url attribute for each platform family or platform 33: case node['platform'] 34: when 'redhat', 'oracle','centos', 'fedora' # ~FC024 35: pkg_repo = "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/#{pkg_major_version}/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}"
Now that Chef Client 12 is EOL, the cookbook needs to be updated to use the newer versions, 13 & 14.
This is the error we are seeing
NoMethodError
undefined method `platform_version' for #
Cookbook Trace:
/var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb:26:in
from_file' /var/chef/cache/cookbooks/mongodb3/recipes/default.rb:20:in
from_file' /var/chef/cache/cookbooks/dc_dr_mongodb/recipes/install.rb:17:infrom_file' /var/chef/cache/cookbooks/dc_dr_mongodb/recipes/default.rb:5:in
from_file'Relevant File Content:
/var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb:
19: 20: pkg_major_version = node['mongodb3']['version'].to_f # eg. 3.0, 3.2 21: 22: # Setup default package version attribute to install 23: pkg_version = node['mongodb3']['version'] 24: case node['platform_family'] 25: when 'rhel', 'fedora' 26>> pkg_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019 27: if node['platform'] == 'amazon' 28: pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019 29: end 30: end 31: 32: # Setup default package repo url attribute for each platform family or platform 33: case node['platform'] 34: when 'redhat', 'oracle','centos', 'fedora' # ~FC024 35: pkg_repo = "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/#{pkg_major_version}/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}"