michaelklishin / cassandra-chef-cookbook

Chef cookbook for Apache Cassandra, DataStax Enterprise (DSE) and DataStax agent
Apache License 2.0
163 stars 228 forks source link

Error install 2.1.0 + #198

Closed markharding closed 9 years ago

markharding commented 9 years ago

The 'log_config_files' is not provided when version 2.1.x is set (now default). This causes a provisioning error of 'undefined method each for nil:NilClass'

==> default: 
==> default: Relevant File Content:
==> default: ----------------------
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/cassandra-dse/recipes/datastax.rb:
==> default: 
==> default: 165:    group node['cassandra']['group']
==> default: 166:    mode 0644
==> default: 167:    notifies :restart, 'service[cassandra]', :delayed if node['cassandra']['notify_restart']
==> default: 
==> default: 168:    variables(:yaml_config => hash_to_yaml_string(node['cassandra']['metrics_reporter']['config']))
==> default: 
==> default: 169:    only_if { node['cassandra']['metrics_reporter']['enabled'] }
==> default: 
==> default: 170:  end
==> default: 171:  
==> default: 172>> node['cassandra']['log_config_files'].each do |f|
==> default: 173:    template ::File.join(node['cassandra']['conf_dir'], f) do
==> default: 174:      source "#{f}.erb"
==> default: 
==> default: 175:      owner node['cassandra']['user']
==> default: 176:      group node['cassandra']['group']
==> default: 177:      mode 0644
==> default: 
==> default: 178:      notifies :restart, 'service[cassandra]', :delayed if node['cassandra']['notify_restart']
==> default: 179:    end
==> default: 
==> default: 180:  end
==> default: 
==> default: 181:  
markharding commented 9 years ago

Issue seems to be in include_recipe.

Originally i had

include_recipe 'cassandra-dse::datastax'

Resolved with

include_recipe 'cassandra-dse'
michaelklishin commented 9 years ago

@markharding yes, we now use an attribute to pick the exact recipe to use. This is a fairly recent change which our docs should reflect. Sorry about this. We had to go through a bunch of breaking changes recently, some are technically completely unnecessary but make publishing to Chef Supermarket possible. I think after 3.3.0 things will slow down quite a bit.