Chef的安装错误

时间:2013-04-05 08:05:57

标签: chef

调试chef-solo时出错了。

当我通过chef-recipes安装nginx时,我可以看到像....in 'from_file这样的问题。我已经下载并安装了epel-release-5-4.noarch.rpm,我还创建了/etc/yum.repos.d/epel.repo

我该怎么做?

* package[vim] action install
* No version specified, and no candidate version available for vim
================================================================================
Error executing action `install` on resource 'package[vim]'
================================================================================


Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for vim


Resource Declaration:
---------------------
# In /root/Development/chef-repo/site-cookbooks/vim/recipes/default.rb

  9: package "vim" do
 10:   action :install
 11: end
 12:



Compiled Resource:
------------------
# Declared in /root/Development/chef-repo/site-cookbooks/vim/recipes/default.rb:9:in `from_file'

package("vim") do
  action [:install]
  retries 0
  retry_delay 2
  package_name "vim"
  cookbook_name :vim
  recipe_name "default"
end

2 个答案:

答案 0 :(得分:0)

实际上,好像已经安装了。 如果我尝试使用nginx -t,我发现了一些错误,我发现了 然后这个厨师的食谱开始工作没有错误。

答案 1 :(得分:0)

如果我从rpm安装了epel-package,它已修复,现在我可以运行我的食谱了。

#
# Cookbook Name:: nginx
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#

yum_package "GeoIP"

yum_package "nginx" do
  action :install
end

template "nginx.conf" do
  path "/etc/nginx/nginx.conf"
  source "nginx.conf.erb"
  owner "root"
  group "root"
  mode 0644
  notifies :reload, 'service[nginx]'
end

service "nginx" do
  action [:enable,:start]
end