2017-04-24 5 views
0

Ich erhalte eine Fehlermeldung, wenn Chef_client Rezepte ausgeführt wird. So weit, ich habe in der Lage, es herauszufinden sagt mir, dass:Chef: undefinierte Methode `platform_version '

nicht definierte Methode `platform_version‘

Ich habe versucht, die Rezepte einen CentOS/7, Version wit auszuführen: 1611.01 und 1703.01. Hier können Sie die komplette Spur sehen:

==> default: ================================================================================ 
==> default: Recipe Compile Error in /var/chef/cache/cookbooks/living-development/recipes/default.rb 
==> default: ================================================================================ 
==> default: 
==> default: NoMethodError 
==> default: ------------- 
==> default: undefined method `platform_version' for #<Chef::Node::Attribute:0x00000004f4f480> 
==> default: 
==> default: Cookbook Trace: 
==> default: --------------- 
==> default: /var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb:26:in `from_file' 
==> default: /var/chef/cache/cookbooks/mongodb3/recipes/default.rb:20:in `from_file' 
==> default: /var/chef/cache/cookbooks/living-development/recipes/mongodb.rb:9:in `from_file' 
==> default: /var/chef/cache/cookbooks/living-development/recipes/default.rb:11:in `from_file' 
==> default: 
==> default: Relevant File Content: 
==> default: ---------------------- 
==> default: /var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb: 
==> default: 
==> default: 19: 
==> default: 20: pkg_major_version = node['mongodb3']['version'].to_f # eg. 3.0, 3.2 
==> default: 21: 
==> default: 22: # Setup default package version attribute to install 
==> default: 23: pkg_version = node['mongodb3']['version'] 
==> default: 24: case node['platform_family'] 
==> default: 25: when 'rhel', 'fedora' 
==> default: 26>>  pkg_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019 
==> default: 27:  if node['platform'] == 'amazon' 
==> default: 28:  pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019 
==> default: 29:  end 
==> default: 30: end 
==> default: 31: 
==> default: 32: # Setup default package repo url attribute for each platform family or platform 
==> default: 33: case node['platform'] 
==> default: 34: when 'redhat', 'oracle','centos', 'fedora' # ~FC024 
==> default: 35:  pkg_repo = "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/#{pkg_major_version}/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}" 
==> default: 
==> default: System Info: 
==> default: ------------ 
==> default: chef_version=13.0.118 
==> default: platform=centos 
==> default: platform_version=7.3.1611 
==> default: ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] 
==> default: program_name=chef-client worker: ppid=12132;start=09:52:48; 
==> default: executable=/opt/chef/bin/chef-client 
==> default: 
==> default: Running handlers: 
==> default: [2017-04-24T09:53:06+00:00] ERROR: Running exception handlers 
==> default: Running handlers complete 
==> default: [2017-04-24T09:53:06+00:00] ERROR: Exception handlers complete 
==> default: Chef Client failed. 0 resources updated in 18 seconds 
==> default: [2017-04-24T09:53:06+00:00] INFO: Sending resource update report (run-id: 30b10346-fc52-4aac-86cd-f76ccd8e0576) 
==> default: [2017-04-24T09:53:07+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out 
==> default: [2017-04-24T09:53:07+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
==> default: [2017-04-24T09:53:07+00:00] ERROR: undefined method `platform_version' for #<Chef::Node::Attribute:0x00000004f4f480> 
==> default: [2017-04-24T09:53:07+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 
Chef never successfully completed! Any errors should be visible in the 
output above. Please fix your recipes so that they properly complete. 

Irgendwelche Ideen?

Umgehen:

config.vm.provision "chef_client" do |chef| 
    ... 
    chef.version = '12.19.36' 
end 

Antwort

3

wir die Methode Syntax für Knoten entfernt Attribute in Chef 13. Der Code muss node["platform_version"] aktualisiert werden.

+0

Gibt es irgendwelche Arbeit, um es jetzt zu lösen? – Jordi

+0

Sicher, roll zurück zu Chef 12. Chef 13 ist sehr neu und nicht alle Gemeinschaftskochbücher haben aktualisiert. – coderanger

+0

Ich habe keine spezielle Kochversion angegeben. Ich schätze, es versucht, die neueste stabile Version zu bekommen. Gibt es eine Möglichkeit, es zu spezifizieren? – Jordi

Verwandte Themen