chef-cookbooks / chef-server

Cookbook to install standalone Chef Server

Home Page:http://supermarket.chef.io/cookbooks/chef-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chef-ingredient 2.0.0 no longer has ChefIngredientCookbook::Helpers.fqdn_resolves?

bradenwright opened this issue · comments

Cookbook version

chef-server 5.1.0
chef-ingredient 2.0.0

Scenario:

Ensure node can resolve ip isn't functional anymore: https://github.com/chef-cookbooks/chef-server/blob/master/recipes/default.rb#L22 Seems like chef-ingredient has removed: ChefIngredientCookbook::Helpers.fqdn_resolves? https://github.com/chef-cookbooks/chef-ingredient/blob/v1.1.0/libraries/helpers.rb#L244 in the latest version

Steps to Reproduce:

Try to use recipe[chef-server] with version listed above.

Expected Result:

Successful run, Helper function works

Actual Result:

       Recipe: chef-server::default
         * ruby_block[ensure node can resolve API FQDN] action run[2017-03-27T18:39:31+00:00] INFO: Processing ruby_block[ensure node can resolve API FQDN] action run (chef-server::default line 22)
       
           
           ================================================================================
           Error executing action `run` on resource 'ruby_block[ensure node can resolve API FQDN]'
           ================================================================================
           
           NoMethodError
           -------------
           undefined method `fqdn_resolves?' for ChefIngredientCookbook::Helpers:Module
           
           Cookbook Trace:
           ---------------
           /tmp/kitchen/cache/cookbooks/chef-server/libraries/helpers.rb:11:in `api_fqdn_resolves?'
           /tmp/kitchen/cache/cookbooks/chef-server/recipes/default.rb:26:in `block (2 levels) in from_file'
           
           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/chef-server/recipes/default.rb
           
            22: ruby_block 'ensure node can resolve API FQDN' do
            23:   extend ChefServerCookbook::Helpers
            24:   block { repair_api_fqdn }
            25:   only_if { api_fqdn_available? }
            26:   not_if { api_fqdn_resolves? }
            27: end
            28: 
           
           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/chef-server/recipes/default.rb:22:in `from_file'
           
           ruby_block("ensure node can resolve API FQDN") do
             action [:run]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             block_name "ensure node can resolve API FQDN"
             declared_type :ruby_block
             cookbook_name "chef-server"
             recipe_name "default"
             block #<Proc:0x00000004c04c58@/tmp/kitchen/cache/cookbooks/chef-server/recipes/default.rb:24>
             not_if { #code block }
             only_if { #code block }
           end
           
           Platform:
           ---------
           x86_64-linux
           
       [2017-03-27T18:39:31+00:00] INFO: Running queued delayed notifications before re-raising exception
       
       Running handlers:
       [2017-03-27T18:39:31+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2017-03-27T18:39:31+00:00] ERROR: Exception handlers complete
       Chef Client failed. 4 resources updated in 14 seconds

Currently got it to work by pinning chef-ingredient cookbook to '~> 1.1'

This is fixed in the latest release. Thanks for the report

berks upload chef-ingredient --force
Uploaded chef-ingredient (2.0.5) to: 'https://api.chef.io:443/organizations/xxxx'

using chef-ingredient 2.0.5, I still got the same error

================================================================================
Error executing action run on resource 'ruby_block[ensure node can resolve API FQDN]'
================================================================================

NoMethodError
-------------
undefined method `fqdn_resolves?' for ChefIngredientCookbook::Helpers:Module

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/chef-server/libraries/helpers.rb:11:in `api_fqdn_resolves?'
/var/chef/cache/cookbooks/chef-server/recipes/default.rb:26:in `block (2 levels) in from_file'

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/chef-server/recipes/default.rb

 22: ruby_block 'ensure node can resolve API FQDN' do
 23:   extend ChefServerCookbook::Helpers
 24:   block { repair_api_fqdn }
 25:   only_if { api_fqdn_available? }
 26:   not_if { api_fqdn_resolves? }
 27: end
 28: