简体   繁体   中英

How to install chef-solo

What's the proper way to install chef-solo on Redhat/Fedora?

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.

[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. For example, on a Mac OS X system with RVM installed in my home directory:

% 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.

Try the Omnibus-built Chef Full stack package. Instructions available here:

Basically, you do this on Linux/Unix platforms.

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.

This installation includes everything above libc for the platform, including Ruby (1.9.2+), RubyGems and other assorted libraries and tools. 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.

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.

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.

Note As of this writing, the full stack installer is in "beta". It will remain in this status until release, which will coincide with the Chef 0.10.10 version's release. It says on the install page that it is not supported, but will be soon.

Install 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.

A complete step-by-step guide is well written here: 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.

It can be found here: https://github.com/scottmuc/gordon

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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