Skip to content

Instantly share code, notes, and snippets.

@joker1007
Created November 27, 2012 10:13
Show Gist options
  • Save joker1007/4153463 to your computer and use it in GitHub Desktop.
Save joker1007/4153463 to your computer and use it in GitHub Desktop.
CentOS 6.3で、シェルスクリプト一発でchefまでインストールする ref: http://qiita.com/items/16d2827519a152b514cd
# root executes this script
# Install Libraries for build
yum -y install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison wget unzip git
# Download Ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
tar xvzf ruby-1.9.3-p327.tar.gz
# Create Install Directory
mkdir /opt/ruby
# Configure and Compile
cd ruby-1.9.3-p327
./configure --prefix /opt/ruby
make
make install
cd
# Chef Install
/opt/ruby/bin/gem install chef
# Clone Cookbooks
git clone git://github.com/opscode/cookbooks.git chef-cookbooks
# Create Chef Directories
mkdir /etc/chef
mkdir /var/chef-solo
# Initial Setting
echo -e "file_cache_path \"/var/chef-solo\"\njson_attribs \"/etc/chef/node.json\"\ncookbook_path \"/root/chef-cookbooks\"" > /etc/chef/solo.rb
echo '{ "run_list": [] }' > /etc/chef/node.json
# Write run_list
# /opt/bin/chef-solo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment