2017-04-13 209 views
0

安裝了以下軟件版本: Berkshelf - 2.0.18 紅寶石 - 2.2.2 流浪 - 1.9.3 測試廚房 - 1.15.0 廚房無業遊民 - 1.1.0 廚師服務器API版本 - 11.0.2測試廚房流浪Berkshelf

我試圖在本地系統上運行測試廚房。 這樣做,我有一個指向chef_api一個berksfile:配置與單一配方貼切

chef_api :config 

cookbook 'apt' 

這個配置是基於我knife.rb配置。 我最我的寶石通過捆綁 安裝這是我的寶石文件

source 'https://artifactory.mia.ucloud.int/artifactory/api/gems/rubygems' do 

    gem 'berkshelf', '~> 2.0.18' 
    gem 'celluloid', '~> 0.16.0' 
    gem 'celluloid-io', '~> 0.16.1' 
    gem 'net-http-persistent', '~> 2.9.0' 
    gem 'test-kitchen' 
    gem 'kitchen-vagrant' 

end 

這裏是.kitchen.yml:

--- 
driver: 
    name: vagrant 

provisioner: 
    name: chef_solo 

platforms: 
    - name: ubuntu-14.04 
    driver: 
     box: ubuntu/trusty64 

suites: 
    - name: default 
    run_list: 
     - recipe[apt::default] 
     - recipe[git::server] 
    attributes: 
    - name: core 
    run_list: 
     - recipe[ultimate_metadefender_core::default] 

我能夠獲得捆綁安裝工作和運行berks安裝工作正常。然而,當我運行一個廚房收斂系統展開時,但隨後到達部署食譜點和失敗,出現以下消息:

-----> Starting Kitchen (v1.15.0) 
-----> Converging <core-ubuntu-1404>... 
     Preparing files for transfer 
     Preparing dna.json 
     Resolving cookbook dependencies with Berkshelf 2.0.18... 
>>>>>> ------Exception------- 
>>>>>> Class: Kitchen::ActionFailed 
>>>>>> Message: 1 actions failed. 
>>>>>>  Failed to complete #converge action: [undefined method `vendor' for 
#<Berkshelf::Berksfile:0x007fdd3d161620>] on core-ubuntu-1404 
>>>>>> ---------------------- 
>>>>>> Please see .kitchen/logs/kitchen.log for more details 
>>>>>> Also try running `kitchen diagnose --all` for configuration 

我再審查日誌,它似乎從測試 - 未來廚房寶石:

-----> Converging <core-ubuntu-1404>... 
    Preparing files for transfer 
    Preparing dna.json 
    Resolving cookbook dependencies with Berkshelf 2.0.18... 
    Converge failed on instance <core-ubuntu-1404>. 
    ------Exception------- 
    Class: NoMethodError 
    Message: undefined method `vendor' for # 
    <Berkshelf::Berksfile:0x007fdd3d161620> 
    ---------------------- 
    ------Backtrace------- 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef/berkshelf.rb:66:in `block in resolve' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/thor-0.18.1/lib/thor/shell/basic.rb:19:in `mute' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef/berkshelf.rb:61:in `resolve' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef/common_sandbox.rb:329:in `block in resolve_with_berkshelf' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef/common_sandbox.rb:326:in `synchronize' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef/common_sandbox.rb:326:in `resolve_with_berkshelf' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef/common_sandbox.rb:260:in `prepare_cookbooks' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef/common_sandbox.rb:48:in `populate' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef_base.rb:126:in `create_sandbox' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef_solo.rb:41:in `create_sandbox' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/base.rb:65:in `call' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/instance.rb:384:in `block in converge_action' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/g 
ems/test-kitchen-1.15.0/lib/kitchen/instance.rb:527:in `synchronize_or_call' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/instance.rb:489:in `block in action' 
    /Users/miker/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:288:in `measure' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/instance.rb:488:in `action' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/instance.rb:380:in `converge_action' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/instance.rb:359:in `block in transition_to' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/instance.rb:358:in `each' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/instance.rb:358:in `transition_to' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/instance.rb:135:in `converge' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/command.rb:197:in `public_send' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/command.rb:197:in `run_action_in_thread' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/test-kitchen-1.15.0/lib/kitchen/command.rb:169:in `block (2 levels) in run_action' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call' 

    /Users/miker/Projects/hp/cav/infrastructure/configuration/vendor/gems/ruby/2.2.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context' 
    ----End Backtrace----- 

在回顧創業板berksfile.rb文件存在使用berksfile創建,然後這個對象最終被稱爲與供應商的方法,不存在一個對象。我不確定此時應該採取何種措施。如果任何人都可以在這個問題上提供一些幫助,將不勝感激。由於我們所在的廚師服務器版本的原因,我停留在這些特定版本上。

根據我在文檔中閱讀的內容,後者的Berkshelf版本需要Berkshelf API版本或Chef API版本12.4或更高版本。不幸的是,在我的情況下都不可能達到

回答

1

一些研究和挖掘身邊後,我能得到這個具有以下

的Gemfile工作:

gem 'rspec', '~> 3.1.0' 
    gem 'test-kitchen', '~> 1.0' 
    gem 'berkshelf', '~> 2.0.0' # DO NOT UPDATE to 3.00 
    gem 'celluloid', '~> 0.16.0' # Added due to bug in bundler ignoring lock file 
    gem 'kitchen-vagrant', '~> 0.15.0' 
    gem 'rest-client', '~> 1.6.7' 
    gem 'json-schema', '~> 2.2.5' 
    gem 'rb-fsevent', '0.9.5' # Added due to ruby restriction with ruby_dep 
    gem 'rb-inotify', '0.9.5' # Added due to ruby restriction with ruby_dep 
    gem 'rack', '1.6.0' #needed to force 

Gemfile.lock的:

GEM 
    remote: http://artifactory.mia.ucloud.int/artifactory/api/gems/rubygems/ 
    specs: 
    activesupport (3.2.22.2) 
     i18n (~> 0.6, >= 0.6.4) 
     multi_json (~> 1.0) 
    addressable (2.3.8) 
    akami (1.3.1) 
     gyoku (>= 0.4.0) 
     nokogiri 
    artifactory (2.3.2) 
    berkshelf (2.0.18) 
     activesupport (~> 3.2.0) 
     addressable (~> 2.3.4) 
     buff-shell_out (~> 0.1) 
     chozo (>= 0.6.1) 
     faraday (~> 0.8.5) 
     hashie (~> 2.0) 
     minitar (~> 0.5.4) 
     rbzip2 (~> 0.2.0) 
     retryable (~> 1.3.3) 
     ridley (~> 1.7.0) 
     solve (~> 0.8.2) 
     thor (~> 0.18.0) 
    buff-config (0.4.0) 
     buff-extensions (~> 0.3) 
     varia_model (~> 0.1) 
    buff-extensions (0.5.0) 
    buff-ignore (1.1.1) 
    buff-ruby_engine (0.1.0) 
    buff-shell_out (0.2.0) 
     buff-ruby_engine (~> 0.1.0) 
    builder (3.2.2) 
    celluloid (0.16.0) 
     timers (~> 4.0.0) 
    celluloid-io (0.16.2) 
     celluloid (>= 0.16.0) 
     nio4r (>= 1.1.0) 
    chozo (0.6.1) 
     activesupport (>= 3.2.0) 
     hashie (>= 2.0.2) 
     multi_json (>= 1.3.0) 
    diff-lcs (1.2.5) 
    erubis (2.7.0) 
    faraday (0.8.11) 
     multipart-post (~> 1.2.0) 
    ffi (1.9.10) 
    gssapi (1.0.3) 
     ffi (>= 1.0.1) 
    gyoku (1.3.1) 
     builder (>= 2.1.2) 
    hashie (2.1.2) 
    hitimes (1.2.4) 
    httpclient (2.8.0) 
    httpi (0.9.7) 
     rack (= 1.6.0) 
    i18n (0.7.0) 
    json (1.8.1) 
    json-schema (2.2.5) 
    kitchen-vagrant (0.15.0) 
     test-kitchen (~> 1.0) 
    little-plugger (1.1.4) 
    logging (1.8.2) 
     little-plugger (>= 1.1.3) 
     multi_json (>= 1.8.4) 
    mime-types (1.25.1) 
    mini_portile2 (2.0.0) 
    minitar (0.5.4) 
    mixlib-authentication (1.3.0) 
     mixlib-log 
    mixlib-install (1.0.11) 
     artifactory 
     mixlib-shellout 
     mixlib-versioning 
    mixlib-log (1.6.0) 
    mixlib-shellout (1.6.1) 
    mixlib-versioning (1.1.0) 
    multi_json (1.12.0) 
    multipart-post (1.2.0) 
    net-http-persistent (2.9.4) 
    net-scp (1.2.1) 
     net-ssh (>= 2.6.5) 
    net-ssh (2.9.4) 
    nio4r (1.2.1) 
    nokogiri (1.6.7.2) 
     mini_portile2 (~> 2.0.0.rc2) 
    nori (1.1.5) 
    rack (1.6.0) 
    rb-fsevent (0.9.5) 
    rb-inotify (0.9.5) 
     ffi (>= 0.5.0) 
    rbzip2 (0.2.0) 
    rest-client (1.6.9) 
     mime-types (~> 1.16) 
    retryable (1.3.6) 
    ridley (1.7.1) 
     addressable 
     buff-config (~> 0.2) 
     buff-extensions (~> 0.3) 
     buff-ignore (~> 1.1) 
     buff-shell_out (~> 0.1) 
     celluloid (~> 0.15) 
     celluloid-io (~> 0.15) 
     erubis 
     faraday (>= 0.8.4) 
     hashie (>= 2.0.2) 
     json (>= 1.7.7) 
     mixlib-authentication (>= 1.3.0) 
     net-http-persistent (>= 2.8) 
     net-ssh 
     retryable 
     solve (>= 0.4.4) 
     varia_model (~> 0.1) 
     winrm (~> 1.1.0) 
    rspec (3.1.0) 
     rspec-core (~> 3.1.0) 
     rspec-expectations (~> 3.1.0) 
     rspec-mocks (~> 3.1.0) 
    rspec-core (3.1.7) 
     rspec-support (~> 3.1.0) 
    rspec-expectations (3.1.2) 
     diff-lcs (>= 1.2.0, < 2.0) 
     rspec-support (~> 3.1.0) 
    rspec-mocks (3.1.3) 
     rspec-support (~> 3.1.0) 
    rspec-support (3.1.2) 
    rubyntlm (0.1.1) 
    safe_yaml (1.0.4) 
    savon (0.9.5) 
     akami (~> 1.0) 
     builder (>= 2.1.2) 
     gyoku (>= 0.4.0) 
     httpi (~> 0.9) 
     nokogiri (>= 1.4.0) 
     nori (~> 1.0) 
     wasabi (~> 1.0) 
    solve (0.8.2) 
    test-kitchen (1.7.3) 
     mixlib-install (~> 1.0, >= 1.0.4) 
     mixlib-shellout (>= 1.2, < 3.0) 
     net-scp (~> 1.1) 
     net-ssh (>= 2.9, < 4.0) 
     safe_yaml (~> 1.0) 
     thor (~> 0.18) 
    thor (0.18.1) 
    timers (4.0.4) 
     hitimes 
    uuidtools (2.1.5) 
    varia_model (0.3.2) 
     buff-extensions (~> 0.2) 
     hashie (>= 2.0.2) 
    wasabi (1.0.0) 
     nokogiri (>= 1.4.0) 
    winrm (1.1.3) 
     gssapi (~> 1.0.0) 
     httpclient (~> 2.2, >= 2.2.0.2) 
     logging (~> 1.6, >= 1.6.1) 
     nokogiri (~> 1.5) 
     rubyntlm (~> 0.1.1) 
     savon (= 0.9.5) 
     uuidtools (~> 2.1.2) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    berkshelf (~> 2.0.0)! 
    celluloid (~> 0.16.0)! 
    json-schema (~> 2.2.5)! 
    kitchen-vagrant (~> 0.15.0)! 
    rack (= 1.6.0)! 
    rb-fsevent (= 0.9.5)! 
    rb-inotify (= 0.9.5)! 
    rest-client (~> 1.6.7)! 
    rspec (~> 3.1.0)! 
    test-kitchen (~> 1.0)! 

BUNDLED WITH 
    1.14.6 

這是不理想但對於處於類似情況的任何人。這是按預期工作的。

0

Berkshelf 2.0很舊,目前的版本是5.x.我們只支持通過ChefDK安裝的Berkshelf,所以請刪除所有現有的副本,然後通過正常的ChefDK安裝程序進行安裝。

+0

我在問題中添加了其他信息。根據我發現使用不同的版本是不可能的,由於廚師服務器的版本,我們正在使用。 – thxmike

+0

我們添加berks API端點的全部原因是因爲那個時代的Berks基本上根本不工作,它不得不在版本解決方案上作弊。您比Berks 2.x更好地手動管理依賴項。我們不支持它,它遠遠超出了生命的終點。 – coderanger

+0

如果你想過去生活,你只需要使用2014年版本的東西。這就是我們現在分發快照安裝程序(ChefDK)的原因。 – coderanger

相關問題