2016-06-28 124 views
1

我想在我的centos 7桌面上使用chefdk和本地模式安装chrome。 chrome使用yum直接安装,我将它作为厨师的学习练习。到目前为止,它无法在aptos 7.2和macosx 10.11.5上进行依赖性检查。 centos的详细信息只出现在下面。基本食谱,例如yum和apt安装很好,所以我在这里错过了一些东西。 感谢您的帮助。厨师烹饪书安装chrome centos7

CentOS Linux release 7.2.1511 (Core) 
Installed: yum-3.4.3-132.el7.centos.0.1.noarch 
using 
chefdk.x86_64        0.15.15-1.el7    @/chefdk-0.15.15-1.el7.x86_64 

knife cookbook show chrome 
chrome 1.2.2 

当我尝试安装:

sudo sudo chef-client --local-mode --runlist 'recipe[chrome]' 2>&1 | tee /export/cookbooks/install_chrome_from_cookbook.2.log 

它会尝试使用apt和失败,因为一个恰当的版本出现故障:请参见下面的日志。

问题是什么?

cat /export/cookbooks/install_chrome_from_cookbook.2.log 

` [2016-06-28T00:35:35-04:00] WARN: No config file found or specified on command line, using command line options. 
> [2016-06-28T00:35:35-04:00] INFO: Auto-discovered chef repository at /export 
> [2016-06-28T00:35:36-04:00] INFO: Started chef-zero at  chefzero://localhost:8889 with repository at /export 
>  One version per cookbook 

> [2016-06-28T00:35:36-04:00] INFO: Forking chef instance to converge... 
> [2016-06-28T00:35:36-04:00] INFO: *** Chef 12.11.18 *** 
> [2016-06-28T00:35:36-04:00] INFO: Platform: x86_64-linux 
> [2016-06-28T00:35:36-04:00] INFO: Chef-client pid: 7293 
> [2016-06-28T00:35:38-04:00] INFO: GET /organizations/chef/nodes/nuctv-w.lfz.net 
> [2016-06-28T00:35:38-04:00] INFO: Setting the run_list to [#<Chef::RunList::RunListItem:0x00000004e13468 @version=nil, @type=:recipe, @name="chrome">] from CLI options 
> [2016-06-28T00:35:38-04:00] INFO: Run List is [recipe[chrome]] 
> [2016-06-28T00:35:38-04:00] INFO: Run List expands to [chrome] 
> [2016-06-28T00:35:38-04:00] INFO: Starting Chef Run for nuctv-w.lfz.net 
> [2016-06-28T00:35:38-04:00] INFO: Running start handlers 
> [2016-06-28T00:35:38-04:00] INFO: Start handlers complete. 
> [2016-06-28T00:35:38-04:00] INFO: POST /organizations/chef/reports/nodes/nuctv-w.lfz.net/runs 
> --- POST BODY --- 
> {"action":"start","run_id":"8532d8c8-2e83-45e3-b867-f55f264a93df","start_time":"2016-06-28 00:35:38 -0400"} 
> --- END POST BODY --- 
> [2016-06-28T00:35:38-04:00] INFO: HTTP Request Returned 404 Not Found: Object not found: 
> [2016-06-28T00:35:38-04:00] INFO: POST /organizations/chef/environments/_default/cookbook_versions 
> --- POST BODY --- 
> {"run_list":["chrome"]} 
> --- END POST BODY --- 
> [2016-06-28T00:35:39-04:00] INFO: #<ChefZero::RestErrorResponse: 412: Could not satisfy version constraints for: apt> 
> /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb:42:in `post' 
> .... 
> /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/bin/chef-client:26:in `<top (required)>' 
> /bin/chef-client:52:in `load' 
> /bin/chef-client:52:in `<main>' 
> [2016-06-28T00:35:39-04:00] INFO: HTTP Request Returned 412 Precondition Failed: Could not satisfy version constraints for: apt 

> ================================================================================ 
> Error Resolving Cookbooks for Run List: 
> ================================================================================ 

> Missing Cookbooks: 
------------------ 
Could not satisfy version constraints for: apt 

Expanded Run List: 
------------------ 
* chrome 

Platform: 
--------- 
x86_64-linux 

[2016-06-28T00:35:39-04:00] ERROR: Running exception handlers 
[2016-06-28T00:35:39-04:00] ERROR: Exception handlers complete 
[2016-06-28T00:35:39-04:00] FATAL: Stacktrace dumped to /root/.chef/local-mode-cache/cache/chef-stacktrace.out 
[2016-06-28T00:35:39-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
[2016-06-28T00:35:39-04:00] ERROR: 412 "Precondition Failed" 
[2016-06-28T00:35:40-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)` 

回答

1

总是需要厨师依赖,即使他们不会被使用。如果您使用Berkshelf或chef push等更现代的食谱上传工具,它会为您处理此问题。