- ちゃんと「入門chef solo」とおりにやってみるのが一番だと思うのでメモ
- chef-repo 作る
C:\Users\hoge> gem install knife-solo
C:\Users\hoge> knife solo init chef-repo
C:\Users\hoge> cd chef-repo
- hello のクックブックを作成する
C:\Users\hoge\chef-repo> knife cookbook create hello -o cookbooks
** Creating cookbook hello
** Creating README for cookbook: hello
** Creating CHANGELOG for cookbook: hello
** Creating metadata for cookbook: hello
- レシピを編集する(C:\Users\hoge\chef-repo\cookbooks\hello\recipes\default.rb)
C:\Users\hoge\chef-repo> notepad cookbooks\hello\recipes\default.rb
- chef-solo レシピを記述するjsonを用意する、\chef-repo の直下でいいらしい
C:\Users\hoge\chef-repo> notepad localhost.json
- 環境変数っぽい定義ファイルを作成しとく
C:\Users\hoge\chef-repo> notepad solo.rb
- さて実行してみる
C:\Users\hoge\chef-repo> chef-solo -c solo.rb -j localhost.json
Starting Chef Client, version 11.6.0
[2013-08-15T23:28:27+09:00] WARN: chef-client doesn't have administrator privile
ges on node hage. This might cause unexpected resource failures.
Compiling Cookbooks...
Converging 1 resources
Recipe: hello::default
* log[Hello, Chef!] action write
Chef Client finished, 1 resources updated
- 実は、[0mとか表示されるけど、とりあえずの目的 "Hello, Chef!" がでてればok
Starting Chef Client, version 11.6.0[0m
[2013-08-15T23:28:27+09:00] WARN: chef-client doesn't have administrator privile
ges on node hage. This might cause unexpected resource failures.
Compiling Cookbooks...[0m
Converging 1 resources[0m
Recipe: hello::default[0m
* log[Hello, Chef!] action write[0m
[0m
Chef Client finished, 1 resources updated[0m