gpt4 book ai didi

chef-infra - 通过 Vagrant + Chef 安装多个包

转载 作者:行者123 更新时间:2023-12-03 20:24:11 26 4
gpt4 key购买 nike

我刚刚发现了 Vagrant + Chef,我正在尝试创建一个简单的方法来在节点上安装多个包。我认为这样的事情可以工作(我是全新的 tu ruby​​):

# (From cookbooks/MY_COOCKBOOK/recipes/default.rb)
# Install required packages
%w{build-essential libncurses5-dev openssl libssl-dev}.each do |pkg|
package pkg do
action :install
end
end

但这失败并出现以下错误:
[default] [Thu, 17 Mar 2011 06:24:27 -0700] INFO: Installing package[libssl-dev] version 0.9.8k-7ubuntu8.5
: stdout
[default] /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/command.rb:184:in `handle_command_failures': stderr
[default] : : stderr
[default] apt-get -q -y install libssl-dev=0.9.8k-7ubuntu8.5 returned 100, expected 0: stderr
[default] (: stderr
[default] Chef::Exceptions::Exec: stderr
[default] )
: stderr
[default] from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/command.rb:131:in `run_command'
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/command.rb:199:in `run_command_with_systems_locale'
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/package/apt.rb:68:in `install_package'
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/package.rb:60:in `action_install'
[...]

: stderr
[default] [Thu, 17 Mar 2011 06:24:34 -0700] ERROR: package[libssl-dev] (/tmp/vagrant-chef/cookbooks-0/erlang-src/recipes/default.rb:22:in `from_file') had an error:
apt-get -q -y install libssl-dev=0.9.8k-7ubuntu8.5 returned 100, expected 0
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/command.rb:184:in `handle_command_failures'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/command.rb:131:in `run_command'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/command.rb:199:in `run_command_with_systems_locale'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/package/apt.rb:68:in `install_package'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/package.rb:60:in `action_install'

我的印象是我在这里缺少一些基本的东西......

最佳答案

事实证明,我只是缺少 Vagrantfile 上的“apt”配方,它在安装所需的软件包之前运行了 apt-get 更新。所以,以上是正确的。

关于chef-infra - 通过 Vagrant + Chef 安装多个包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5339690/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com