sous-chefs / elasticsearch

Development repository for the elasticsearch cookbook
https://supermarket.chef.io/cookbooks/elasticsearch
Other
881 stars 599 forks source link

chef-sugar is not available anymore #724

Closed torson closed 5 years ago

torson commented 5 years ago

This cookbook relies on chef-sugar, but chef-sugar was removed by the author due to personal reasons: https://github.com/sethvargo/chef-sugar/ Is there an easy fix for this?

yacn commented 5 years ago

chef forked it and renamed the gem to chef-sugar-ng so the cookbook needs to be updated to point to the new fork.

https://github.com/chef/chef-sugar

torson commented 5 years ago

Thanks, I've solved it for myself. The gem got renamed, but not the cookbook name itself. The Chef guys resolved it in a way you don't need to change anything I think if you're running Chef v13 or above. I'm still using Chef v12 and fortunately they've migrated also version 4.2.2 that supports it, so I've pulled down the elasticsearch cookbook and set the version to 4.2.2 in its metadata.rb and in Chef environment file.

andresp99999 commented 5 years ago

@torson would you mind sharing the changes you did to the cookbook? I ran into same issue and I am trying to sort it out. Thanks!

torson commented 5 years ago

@andresp99999 do these steps:

  1. download the elasticsearch cookbook and make this modification in metadata.rb

    depends 'chef-sugar', '= 4.2.2'
  2. upload elasticsearch cookbook to your Chef server

    knife cookbook upload elasticsearch
  3. add the same line to your project Berksfile

  4. fetch the cookbook and upload it to Chef server

    berks update chef-sugar
    berks install
    berks upload
  5. set version in project environment/*.json files, inside variable cookbook_versions :

    "chef-sugar": "= 4.2.2"
  6. upload environment files

    for file in environments/* ; do knife environment from file $file ; done

    At this point it started working for me, Chef client pulled chef-sugar cookbook v4.2.2 which then installed chef-sugar-ng gem v4.2.2 . I am using an old version of this elasticsearch cookbook - v2.0.1 , though I don't think that makes any difference regarding cookbook/gem versioning.

andresp99999 commented 5 years ago

@torson, this helps. Thanks a lot!