4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

chefインストールスクリプト

4
Posted at

お名前.comで借りたVPS(CentOS6.2)でjoker1007 さんが投稿したスクリプト
を動かすと、libyaml-develがインストールされないので、
rubyインストールでエラーとなる。
リポジトリにEPELを追加すれば良いみたいなんだけど、
何となく嫌なので、libyamlをソースからコンパイルするように
スクリプトを修正してみた。

install-chef.sh
# CentOS 6.3
# root executes this script

# Install Libraries for build
yum -y install gcc-c++ patch readline readline-devel zlib zlib-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison wget unzip git

# Install libyaml
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar -zxvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make;make install
cd ../
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

# 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

libyamlは/usr/local/lib以下にインストールされるので、
スクリプトの中でLD_LIBRARY_PATHを設定している。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?