chef とは ?

インストール

Hello Cookbook

レポジトリの作成

[~/chef-hello]$ git clone git://github.com/opscode/chef-repo.git
Cloning into 'chef-repo'...
remote: Reusing existing pack: 223, done.
remote: Total 223 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (223/223), 46.09 KiB | 0 bytes/s, done.
Resolving deltas: 100% (56/56), done.
Checking connectivity... done

[~/chef-hello]$ tree
.
└── chef-repo
    ├── LICENSE
    ├── README.md
    ├── Rakefile
    ├── certificates
    │   └── README.md
    ├── chefignore
    ├── config
    │   └── rake.rb
    ├── cookbooks
    │   └── README.md
    ├── data_bags
    │   └── README.md
    ├── environments
    │   └── README.md
    └── roles
        └── README.md

7 directories, 10 files
[~/chef-hello]$

クックブックを作る

[~/chef-hello]$ cd chef-repo/

[~/chef-hello/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

[~/chef-hello/chef-repo]$ tree cookbooks/
cookbooks/
├── README.md
└── hello
    ├── CHANGELOG.md
    ├── README.md
    ├── attributes
    ├── definitions
    ├── files
    │   └── default
    ├── libraries
    ├── metadata.rb
    ├── providers
    ├── recipes
    │   └── default.rb
    ├── resources
    └── templates
        └── default

11 directories, 5 files
[~/chef-hello/chef-repo]$

実行

[~/chef-hello/chef-repo]$ sudo chef-solo -c solo.rb -j ./localhost.json
Password:
Starting Chef Client, version 11.8.2
Compiling Cookbooks...
Converging 1 resources
Recipe: hello::default
  * log[Hello Chef!] action write

Chef Client finished, 1 resources updated

Chef


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS   sitemap
Last-modified: 2014-02-09 (日) 02:05:06 (3951d)
Short-URL:
ISBN10
ISBN13
9784061426061