简体   繁体   English

如何安装chef-solo

[英]How to install chef-solo

What's the proper way to install chef-solo on Redhat/Fedora? 在Redhat / Fedora上安装chef-solo的正确方法是什么?

I tried following the directions at the opscode wiki , but after running gem install chef --no-ri --no-rdoc , which chef-solo and ls /usr/bin/chef* shows nothing was installed. 我尝试按照opscode wiki上的说明进行操作 ,但在运行gem install chef --no-ri --no-rdocwhich chef-solols /usr/bin/chef*显示没有安装任何内容。

[root@localhost ~]# gem install chef --no-ri --no-rdoc
Successfully installed chef-0.10.8
1 gem installed
[root@localhost ~]# ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

You can use gem env to find the directory where gem binaries will be installed. 您可以使用gem env查找将安装gem二进制文件的目录。 For example, on a Mac OS X system with RVM installed in my home directory: 例如,在我的主目录中安装了RVM的Mac OS X系统上:

% gem env | grep EXECUTABLE
  - RUBY EXECUTABLE: /Users/jtimberman/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/jtimberman/.rvm/gems/ruby-1.9.3-p0/bin

Generally though, deploying Ruby with RVM or similar compile-from-source strategies takes a long time, and the "shell magic" these tools use can lead to confusion. 一般来说,使用RVM部署Ruby或类似的源代码编译策略需要很长时间,而这些工具使用的“shell魔法”会导致混淆。

Try the Omnibus-built Chef Full stack package. 尝试使用Omnibus构建的 Chef Full堆栈包。 Instructions available here: 这里提供的说明:

Basically, you do this on Linux/Unix platforms. 基本上,您在Linux / Unix平台上执行此操作。

wget -O- https://opscode.com/chef/install.sh | sudo bash

The install.sh simply examines the local system's platform and architecture and uses that information to compose a URL of the directory in the S3 bucket for the full stack packages for supported platforms. install.sh只检查本地系统的平台和体系结构,并使用该信息组成S3存储桶中目录的URL,以获取支持平台的完整堆栈包。

This installation includes everything above libc for the platform, including Ruby (1.9.2+), RubyGems and other assorted libraries and tools. 此安装包括平台的libc以上的所有内容,包括Ruby(1.9.2 +),RubyGems和其他各种库和工具。 This means you can still install Ruby in your preferred manner (by using a cookbook, of course) for your Ruby-based applications (if any) without modifying the Ruby environment that Chef needs, and you will have a Ruby version known and well tested to work with Chef. 这意味着你仍然可以以你喜欢的方式安装Ruby(当然,通过使用菜谱)来安装基于Ruby的应用程序(如果有的话),而无需修改Chef所需的Ruby环境,并且你将拥有一个已知且经过充分测试的Ruby版本与Chef合作。

The other installation paths (RubyGems, etc) continue to be available, but this is by far the least hassle, and will be the best supported method to install Chef on any platform Opscode supports. 其他安装路径(RubyGems等)仍然可用,但这是迄今为止最不麻烦的,并且将是在Opscode支持的任何平台上安装Chef的最佳支持方法。

Also, as of now, and version 0.10.10+, the chef-full bootstrap template will be the default for those who use knife bootstrap to automatically set up Chef client systems. 此外,截至目前,以及0.10.10+版本, Chef-full bootstrap模板将成为使用knife bootstrap自动设置Chef客户端系统的人的默认模板

Note As of this writing, the full stack installer is in "beta". 注意在撰写本文时,完整堆栈安装程序处于“beta”状态。 It will remain in this status until release, which will coincide with the Chef 0.10.10 version's release. 它将保持此状态直到发布,这将与Chef 0.10.10版本的发布一致。 It says on the install page that it is not supported, but will be soon. 它在安装页面上说它不受支持,但很快就会支持。

Install ChefDK: 安装ChefDK:

sudo rpm -Uvh https://packages.chef.io/files/stable/chefdk/2.5.3/el/7/chefdk-2.5.3-1.el7.x86_64.rpm

ChefDK contains chef-solo as well. ChefDK也包含chef-solo

A complete step-by-step guide is well written here: http://codeflex.co/creating-and-running-your-first-chef-cookbook/ 这里有一个完整的分步指南: http//codeflex.co/creating-and-running-your-first-chef-cookbook/

Scott Muc has a great bootstrap script/tool called Gordon.It also includes an example. Scott Muc有一个很棒的bootstrap脚本/工具叫Gordon。它还包括一个例子。

It can be found here: https://github.com/scottmuc/gordon 它可以在这里找到: https//github.com/scottmuc/gordon

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM