gpt4 book ai didi

centos - 如何使用 Chef 在 vagrant centos 盒子上设置综合构建器环境?

转载 作者:行者123 更新时间:2023-12-04 19:44:40 25 4
gpt4 key购买 nike

我需要一个综合构建器框来构建 python cli 包。

我想使用 this cookbook , 在 this vagrantbox

我以 root 身份运行它,因为综合安装程序需要使用/opt 中的数据检查某些内容

我的 vagrantfile 看起来像这样:

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "centos65opscode"
# config.vm.provision "chef_solo" do |chef|
# chef.add_recipe "omnibus"
# end
config.librarian_chef.cheffile_dir = "chef"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "chef/cookbooks"
chef.add_recipe "omnibus"
end
end

由于 vagrant 的 Librarian chef 插件似乎没有做任何事情,我手动添加了所有依赖项:

我收到此错误:
==> default: NameError
==> default: ---------
==> default: uninitialized constant Chef::Sugar::DSL
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default: /tmp/vagrant-chef/745d120a7b8f9ecb5d8e9f185062c794/cookbooks/languages/libraries/_helper.rb:31:in `<module:Helper>'
==> default: /tmp/vagrant-chef/745d120a7b8f9ecb5d8e9f185062c794/cookbooks/languages/libraries/_helper.rb:30:in `<module:Languages>'
==> default: /tmp/vagrant-chef/745d120a7b8f9ecb5d8e9f185062c794/cookbooks/languages/libraries/_helper.rb:29:in `<top (required)>'
==> default: Relevant File Content:
==> default: ----------------------
==> default: /tmp/vagrant-chef/745d120a7b8f9ecb5d8e9f185062c794/cookbooks/languages/libraries/_helper.rb:
==> default:
==> default: 24: rescue LoadError
==> default: 25: Chef::Log.warn 'chef-sugar gem could not be loaded.'
==> default: 26: end
==> default: 27:
==> default: 28: # Various code vendored from omnibus cookbook
==> default: 29: module Languages
==> default: 30: module Helper
==> default: 31>> include Chef::Sugar::DSL if Chef.const_defined?('Sugar')
==> default: 32:
==> default: 33: #
==> default: 34: # Performs a `File.join` but ensures all forward slashes are replaced
==> default: 35: # by backward slashes.
==> default: 36: #
==> default: 37: # @return [String]
==> default: 38: #
==> default: 39: def windows_safe_path_join(*args)
==> default: 40: ::File.join(args).gsub(::File::SEPARATOR, ::File::ALT_SEPARATOR)

最佳答案

你试过用vagrant chef provisioning

Vagrant.configure("2") do |config|
config.vm.provision "chef_solo" do |chef|
chef.add_recipe "omnibus"
end
end

并添加 github omnibus cookbooks 中的项目像这样的目录
.
|-- Vagrantfile
|-- cookbooks
| |-- omnibus
| |-- recipes
| |-- default.rb
| |-- ...

关于centos - 如何使用 Chef 在 vagrant centos 盒子上设置综合构建器环境?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35868965/

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