You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def define_node(config, node_name, ip_address=nil, the_recipe=nil)
config.vm.define node_name do |node|
node.vm.hostname = node_name.to_s
node.vm.network :private_network, ip: ip_address if ip_address
node.vm.provision :chef_client do |chef|
chef.provisioning_path = "/etc/chef"
chef.chef_server_url = "https://api.opscode.com/organizations/awo"
chef.validation_key_path = ".chef/awo-validator.pem"
chef.validation_client_name = "awo-validator"
chef.node_name = node_name.to_s
chef.add_recipe the_recipe if the_recipe
end
end
end
Vagrant.configure("2") do |config|
config.vm.box = "opscode-ubuntu-14.04"
config.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
config.omnibus.chef_version = :latest
config.berkshelf.enabled = true
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
end
define_node(config, :ha1, "192.168.0.101", 'my_cookbook')
define_node(config, :ha2, "192.168.0.102", 'my_cookbook')
end
Expected Result:
heartbeat should be configured to manage IP 192.168.0.100 with two hosts ha1 and ha2.
Actual Result:
[2016-12-23T20:26:23+00:00] DEBUG: Loading recipe heartbeat::config via include_recipe
[2016-12-23T20:26:23+00:00] DEBUG: Found recipe config in cookbook heartbeat
[2016-12-23T20:26:23+00:00] DEBUG: Loading recipe heartbeat via include_recipe
[2016-12-23T20:26:23+00:00] DEBUG: I am not loading heartbeat, because I have already seen it.
[2016-12-23T20:26:23+00:00] DEBUG: Resources for generic heartbeat resource enabled on node include: [Custom resource heartbeat from cookbook heartbeat]
[2016-12-23T20:26:23+00:00] DEBUG: Resource for heartbeat is Custom resource heartbeat from cookbook heartbeat
[2016-12-23T20:26:23+00:00] DEBUG: Trying to load heartbeat resource heartbeat_ipaddr for ipaddr
[2016-12-23T20:26:23+00:00] DEBUG: Resources for generic heartbeat_ipaddr resource enabled on node include: [Custom resource heartbeat_ipaddr from cookbook heartbeat]
[2016-12-23T20:26:23+00:00] DEBUG: Resource for heartbeat_ipaddr is Custom resource heartbeat_ipaddr from cookbook heartbeat
[2016-12-23T20:26:23+00:00] DEBUG: Filtered backtrace of compile error: /var/chef/cache/cookbooks/heartbeat/libraries/default.rb:65:in `method_missing',/var/chef/cache/cookbooks/heartbeat/resources/default.rb:52:in `resources',/var/chef/cache/cookbooks/heartbeat/recipes/config.rb:40:in `block in from_file',/var/chef/cache/cookbooks/heartbeat/recipes/config.rb:22:in `from_file',/var/chef/cache/cookbooks/my_cookbook/recipes/default.rb:24:in `from_file'
[2016-12-23T20:26:23+00:00] DEBUG: Backtrace entry for compile error: '/var/chef/cache/cookbooks/heartbeat/libraries/default.rb:65:in `method_missing''
[2016-12-23T20:26:23+00:00] DEBUG: Line number of compile error: '65'
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/my_cookbook/recipes/default.rb
================================================================================
Chef::Exceptions::ProviderNotFound
----------------------------------
Cannot find a provider for heartbeat_ipaddr[192.168.0.100] on ubuntu version 14.04
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/heartbeat/libraries/default.rb:65:in `method_missing'
/var/chef/cache/cookbooks/heartbeat/resources/default.rb:52:in `resources'
/var/chef/cache/cookbooks/heartbeat/recipes/config.rb:40:in `block in from_file'
/var/chef/cache/cookbooks/heartbeat/recipes/config.rb:22:in `from_file'
/var/chef/cache/cookbooks/my_cookbook/recipes/default.rb:24:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/heartbeat/libraries/default.rb:
58: raise e
59: end
60: end
61: end
62: raise NameError, "No resource found for #{name}. Tried #{lookup_path.join(', ')}" unless resource
63: raise ArgumentError, "Resource instance #{resource} is not a valid heartbeat resource" unless resource.respond_to?(:to_resource)
64: provider = resource.provider || begin
65>> Chef::Platform.provider_for_resource(resource)
66: rescue ArgumentError => e
67: nil
68: end
69: # As a default this has #action_nothing on it
70: resource.provider Chef::Provider::HeartbeatNull unless provider
71: @sub_resources << resource
72: resource
73: end
74: end
Platform:
---------
x86_64-linux
[2016-12-23T20:26:23+00:00] DEBUG: Re-raising exception: Chef::Exceptions::ProviderNotFound - Cannot find a provider for heartbeat_ipaddr[192.168.0.100] on ubuntu version 14.04
/
Actual result with Chef client 12.3.0:
* heartbeat[heartbeat] action create
================================================================================
Error executing action `create` on resource 'heartbeat[heartbeat]'
================================================================================
ArgumentError
-------------
comparison of String with nil failed
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/heartbeat/providers/default.rb:56:in `sort_by'
/var/chef/cache/cookbooks/heartbeat/providers/default.rb:56:in `block (2 levels) in class_from_file'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb:90:in `instance_eval'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb:90:in `build'
/var/chef/cache/cookbooks/heartbeat/providers/default.rb:49:in `block in class_from_file'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb:25:in `block in action'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb:52:in `instance_eval'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb:52:in `recipe_eval_with_update_check'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
The text was updated successfully, but these errors were encountered:
Cookbook version
1.0.0 - 2.0.0
Chef-client version
12.4.3, 12.17.44, 12.18.2
Using 12.0.3 I get another error...
Platform Details
opscode-ubuntu-16.04 & opscode-ubuntu-14.04
https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-16.04_chef-provisionerless.box & https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box
Scenario:
I try to setup two VMs with heartbeat but the Chef client run fails:
Cannot find a provider for heartbeat_ipaddr["X.X.X.X"] on ubuntu version 16.04
I'm pretty sure that heartbeat 1.0.0 used to work in 2015. Maybe a problem with newer Chef client versions?
Steps to Reproduce: mycookbook::default
Vagrantfile
Expected Result:
heartbeat should be configured to manage IP 192.168.0.100 with two hosts ha1 and ha2.
Actual Result:
Actual result with Chef client 12.3.0:
The text was updated successfully, but these errors were encountered: