0

I am trying to write my first wrapper chef cookbook around elastic search and have run into a problem when running elasticsearch_configure and elasticsearch_service

The error goes like this

RuntimeError
  ------------
  File templates/default/elasticsearch.in.sh.erb does not exist for cookbook elasticsearch

I can confirm that the elasticsearch cookbook does have the file in question.

The offending resources

elasticsearch_configure 'elasticsearch-logging'

elasticsearch_service 'elasticsearch-logging' do
   service_actions :enable
end

I am testing all of this with chef-solo using chef-solo -c config.rb -j test.json

config.rb

cookbook_path ["/tmp/cookbooks",
               "/user/.berkshelf/cookbooks/"]
local_mode true
chef_zero.enabled true

test.json

{
   "run_list": [
      "recipe[elastic-cookbook::default]"
   ]
}

Any help would be greatly appreciated

  • The error says cookbook `elastic search` - I would expect `elasticsearch`. Check if you added the space in your wrapper cookbook. – StephenKing Feb 18 '16 at 05:42
  • This was just a typo it is in fact 'elasticsearch' – user3180053 Feb 18 '16 at 05:47
  • Can you provide the complete code of your cookbook, e.g. on Github? – StephenKing Feb 18 '16 at 06:56
  • @StephenKing It's the standard cookbook from https://github.com/elastic/cookbook-elasticsearch, just based on the error message. – coderanger Feb 18 '16 at 07:25
  • Yes, but I cannot reproduce this issue. The recipe [here](https://gist.github.com/StephenKing/b698c6f873e423a01e50) works for me. – StephenKing Feb 18 '16 at 07:52
  • @StephenKing I used you recipe above and this failed for me also. Updated post below with how I am trying to run this on RHEL. Very new to chef! – user3180053 Feb 18 '16 at 09:27
  • 1
    The only thing I can think of is that you downloaded the elasticsearch cookbook in a directory not named elasticsearch but that sounds very strange, may you create a gist of the chef-run on debug mode (add `-l debug` to your command line) – Tensibai Feb 18 '16 at 09:42

1 Answers1

0

You downloaded the cookbook to a folder elastic-cookbook (I think). It needs to be in cookbooks/elasticsearch to work.

coderanger
  • 52,400
  • 4
  • 52
  • 75