如何使用chef在vagrant centos box上设置omnibus builder环境?
我需要一个用于构建python cli包的综合构建器框 我想用,对吗 我以root用户身份运行它,因为omnibus安装程序需要使用/opt中的数据检查某些内容 我的文件如下所示:如何使用chef在vagrant centos box上设置omnibus builder环境?,centos,vagrant,chef-infra,chef-solo,Centos,Vagrant,Chef Infra,Chef Solo,我需要一个用于构建python cli包的综合构建器框 我想用,对吗 我以root用户身份运行它,因为omnibus安装程序需要使用/opt中的数据检查某些内容 我的文件如下所示: # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "centos65opscode" # config.vm.provision "chef_solo" do |chef| #
# -*- 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的Library 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)
==>默认值:name错误
==>默认值:---------
==>默认值:未初始化的常量Chef::Sugar::DSL
==>默认值:
==>默认值:Cookbook跟踪:
==>默认值:---------------
==>默认值:/tmp/vagrant chef/745d120a7b8f9ecb5d8e9f185062c794/cookbooks/languages/libraries/\u helper.rb:31:in`'
==>默认值:/tmp/vagrant chef/745d120a7b8f9ecb5d8e9f185062c794/cookbooks/languages/libraries/\u helper.rb:30:in`'
==>默认值:/tmp/vagrant chef/745d120a7b8f9ecb5d8e9f185062c794/cookbooks/languages/libraries/\u helper.rb:29:in`'
==>默认值:相关文件内容:
==>默认值:----------------------
==>默认值:/tmp/vagrant chef/745d120a7b8f9ecb5d8e9f185062c794/cookbooks/languages/libraries/_helper.rb:
==>默认值:
==>默认值:24:rescue LoadError
==>默认值:25:Chef::Log.warn“无法加载Chef sugar gem。”
=>默认值:26:结束
==>默认值:27:
==>默认值:28:#从omnibus cookbook提供的各种代码
==>默认值:29:模块语言
==>默认值:30:模块帮助器
==>默认值:31>>如果定义了Chef.const_,则包含Chef::Sugar::DSL('Sugar')
==>默认值:32:
==>默认值:33:#
==>默认值:34:#执行“File.join”,但确保替换所有前斜杠
==>默认值:35:#通过向后斜杠。
==>默认值:36:#
==>默认值:37:#@return[String]
==>默认值:38:#
==>默认值:39:def windows\u safe\u path\u join(*args)
==>默认值:40:::File.join(args).gsub(::File::SEPARATOR,::File::ALT\u SEPARATOR)
您尝试过使用
并将githubomnibus
项目添加到cookbooks
目录中,如
.
|-- Vagrantfile
|-- cookbooks
| |-- omnibus
| |-- recipes
| |-- default.rb
| |-- ...
因此,为了实现这一点,我需要chef在盒子上,所以我得到了一个带有chef的盒子:~/dev/envs/centos65opscode cat Vagrantfile#--mode:ruby--vi:set ft=ruby:Vagrant.configure(2)do | config | config.vm.box=“centos65opscode”config.vm.provision“chef|u solo”do | chef | chef.add_食谱“omnibus”end~/dev/envs/centos65opscode 树。├── 流浪汉档案└── 食谱└── omnibus |--…==>默认值:[2016-03-09T09:34:09+00:00]错误:找不到Cookbook 7-zip。如果您正在从另一本食谱加载7-zip,请确保在元数据==>default:[2016-03-09T09:34:10+00:00]中配置依赖项致命:Chef::Exceptions::ChildConvergence错误:Chef运行进程退出失败(退出代码1)如果这是linux,为什么我需要7-zip?7-zip是一本windows烹饪书。此外,在厨师超市,下载7-zip烹饪书的文件不是zip文件,也不是tar文件,不确定那是什么。。。所以我无法提取它并将其放在同一个文件夹中。有没有办法告诉chef在线获取此依赖项?pip从pypi中获取python依赖项的方法也是一样的?我知道有些人用它来管理这些依赖项
.
|-- Vagrantfile
|-- cookbooks
| |-- omnibus
| |-- recipes
| |-- default.rb
| |-- ...