StackStorm / chef-stackstorm

DEPRECATED! Community-maintained Chef Cookbook to deploy StackStorm, IFTTT for Ops
https://supermarket.chef.io/cookbooks/stackstorm
Apache License 2.0
16 stars 10 forks source link

Fix Chef 13 CI build failures #65

Closed arm4b closed 6 years ago

arm4b commented 7 years ago

Closes #63.

Outdated rabbitmq cookbok produces the following error (https://travis-ci.org/StackStorm/chef-stackstorm/jobs/234373310) in Chef 13:

 Compiling Cookbooks...
================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/rabbitmq/resources/parameter.rb
      ================================================================================       
       ArgumentError
       -------------
       Property `params` of resource `rabbitmq_parameter` overwrites an existing method.

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/rabbitmq/resources/parameter.rb:27:in `class_from_file'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/rabbitmq/resources/parameter.rb:

        20:  
        21:  actions :set, :clear, :list
        22:  default_action :set
        23:  
        24:  attribute :parameter, :kind_of => String, :name_attribute => true
        25:  attribute :component, :kind_of => String
        26:  attribute :vhost, :kind_of => String
        27>> attribute :params, :kind_of => [Hash, Array], :default => {}
        28:  

       System Info:

Seems that https://github.com/rabbitmq/chef-cookbook build is GREEN again and we can use latest rabbitmq.

Checking...

arm4b commented 7 years ago

Another error (https://travis-ci.org/StackStorm/chef-stackstorm/jobs/234797606) from outdated mongodb3 cookbook (https://github.com/sunggun-yu/chef-mongodb3)

NoMethodError
       -------------
       undefined method `platform_version' for #<Chef::Node::Attribute:0x00000005343460>

       Cookbook Trace:

       ---------------
         /tmp/kitchen/cache/cookbooks/mongodb3/recipes/package_repo.rb:26:in `from_file'
         /tmp/kitchen/cache/cookbooks/mongodb3/recipes/default.rb:20:in `from_file'
         /tmp/kitchen/cache/cookbooks/stackstorm/recipes/bundle.rb:45:in `from_file'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/mongodb3/recipes/package_repo.rb:

        19:  
        20:  pkg_major_version = node['mongodb3']['version'].to_f # eg. 3.0, 3.2
        21:  
        22:  # Setup default package version attribute to install
        23:  pkg_version = node['mongodb3']['version']
        24:  case node['platform_family']
        25:    when 'rhel', 'fedora'
        26>>     pkg_version =  "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
        27:      if node['platform'] == 'amazon'
        28:        pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019
        29:      end
        30:  end
        31:  
        32:  # Setup default package repo url attribute for each platform family or platform
        33:  case node['platform']
        34:    when 'redhat', 'oracle','centos', 'fedora' # ~FC024
        35:      pkg_repo = "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/#{pkg_major_version}/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}"
shortdudey123 commented 7 years ago

Yeah, i have a long standing PR to clean up mongodb3 https://github.com/sunggun-yu/chef-mongodb3/pull/55 I would not count on it being merged anytime soon though

arm4b commented 7 years ago

Holy moly, yeah we're stuck here for a long time.

@shortdudey123 what you can suggest as a workaround? Switching to Chef 12 or maybe using another mongo cookbook? I didn't find anything, where I could use 3.2 or 3.4 mongodb-org packages (that's what StackStorm is currently supporting).

shortdudey123 commented 7 years ago

I would hard code testing to 12.20.3 (think thats the newest 12.x) and add a note in the readme saying the cookbook is chef 13 compliment, but not all of the upstream dependencies are.

I have done that with several other cookbooks i work with

arm4b commented 7 years ago

@shortdudey123 That makes sense :+1: Thanks, will do!

jjm commented 6 years ago

Having a look at the chef cookbook and indeed the mongodb3 cookbook does not yet support Chef 13+ and may may be better to migrate to using https://supermarket.chef.io/cookbooks/sc-mongodb (aka https://github.com/sous-chefs/mongodb) instead.