OSS(Open Source Software)/chef 2014. 4. 14. 18:03

chef-solo를 이용해 패키지를 설치해 본다.


레시피 파일을 수정(default.rb)

package "php" do

action :install

end


실행

chef-solo -c solo.rb -j localhost.json



여러 개의 패키지를 한번에 설치 하기 - 반복문 이용

%w{zsh gcc make yum-utils}.each do |pkg|

        package pkg do

                action :install

        end

end


실행

# chef-solo -c solo.rb -j localhost.json

[Mon, 14 Apr 2014 18:01:09 +0900] INFO: *** Chef 0.10.6 ***

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Setting the run_list to ["recipe[hello]"] from JSON

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Run List is [recipe[hello]]

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Run List expands to [hello]

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Starting Chef Run for localhost

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Running start handlers

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Start handlers complete.

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Processing log[Hello, Chef!] action write (hello::default line 9)

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Hello, Chef!

[Mon, 14 Apr 2014 18:01:10 +0900] INFO: Processing package[zsh] action install (hello::default line 12)

[Mon, 14 Apr 2014 18:01:13 +0900] INFO: package[zsh] installed version 4.3.10-5.el6

[Mon, 14 Apr 2014 18:01:13 +0900] INFO: Processing package[gcc] action install (hello::default line 12)

[Mon, 14 Apr 2014 18:01:13 +0900] INFO: Processing package[make] action install (hello::default line 12)

[Mon, 14 Apr 2014 18:01:13 +0900] INFO: Processing package[yum-utils] action install (hello::default line 12)

[Mon, 14 Apr 2014 18:01:15 +0900] INFO: package[yum-utils] installed version 1.1.30-14.el6

[Mon, 14 Apr 2014 18:01:15 +0900] INFO: Chef Run complete in 4.967731 seconds

[Mon, 14 Apr 2014 18:01:15 +0900] INFO: Running report handlers

[Mon, 14 Apr 2014 18:01:15 +0900] INFO: Report handlers complete


'OSS(Open Source Software) > chef' 카테고리의 다른 글

Resource란?  (0) 2014.04.14
멱등성이란?  (0) 2014.04.14
chef solo  (0) 2014.04.14
knife 초기 설정  (0) 2014.04.14
리포지터리(키친), 쿡북, 레시피  (0) 2014.04.14
posted by 구닥다리 엔지니어
: