そろそろ、ある程度は理解しておかないと置いていかれそうなので...
ダウンロードは下記(本家)から可能です。ここではRHEL6(CentOS6)用を
使っていますが、いろいろなプラットホーム毎に用意されています。
Install Chef
インストール
# curl -L https://www.opscode.com/chef/install.sh | bash ... Downloading Chef for el... ... Installing Chef 警告: /tmp/tmp.wlXWdFaE/chef-.x86_64.rpm: ヘッダ V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY 準備中... ################################# [100%] 1:chef ################################# [100%] Thank you for installing Chef!
Gitリポジトリの作成
# mkdir -p /var/chef/cookbooks # cd /var/chef/cookbooks # git init Initialized empty Git repository in /var/chef/cookbooks/.git/
JSONファイルの用意
# cat localhost.json
{
"run_list": [
"apache2"
]
}
下記の"apache2"の"cookbook"を利用する想定です。Opscode Community
コミット
# git add . # git commit -m init ... create mode 100644 localhost.json※"/var/chef/cookbooks"はGitリポジトリにしてコミットまでしてないと
下記がうまく行きませんでした...
"cookbook"のダウンロード?
# knife cookbook site vendor apache2 WARNING: No knife configuration file found Installing apache2 to /var/chef/cookbooks Checking out the master branch. Creating pristine copy branch chef-vendor-apache2 Downloading apache2 from the cookbooks site at version 1.6.2 to /var/chef/cookbooks/apache2.tar.gz Cookbook saved: /var/chef/cookbooks/apache2.tar.gz Removing pre-existing version. Uncompressing apache2 version 1.6.2. removing downloaded tarball 1 files updated, committing changes Creating tag cookbook-site-imported-apache2-1.6.2 Checking out the master branch. Updating ec540d0..2dc8dcb Fast-forward ... 111 files changed, 5491 insertions(+), 0 deletions(-) ... Cookbook apache2 version 1.6.2 successfully installed上記の"Opscode Community"からダウンロード?しています。
適用?
# chef-solo -j localhost.json ...上記で作成したJSONファイルを指定しています。
確認
# ps aux | grep http root 2103 0.0 0.4 73352 2508 ? Ss 11:08 0:00 /usr/sbin/httpd apache 2106 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2107 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2108 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2109 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2110 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2111 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2112 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2113 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2114 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2115 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2116 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2117 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2118 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2119 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2120 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpd apache 2121 0.0 0.3 73352 1924 ? S 11:08 0:00 /usr/sbin/httpdちゃんと"httpd"まで立ち上がってました!
言葉(用語)の使い方に、まだ自身が持てない...
--------
http://www.suz-lab.com

