LoginSignup
2
2

More than 5 years have passed since last update.

ChefのAttributeの優先順位

Posted at

ChefにはAttributeの値を定義できる場所が複数あります。
同名のAttributeを定義した場合、優先度の高いAttributeの値が
最終的に利用されることになります。

下の表では、下から上に優先度が高くなっています。

また、リポジトリのディレクトリを例として/tmp/chef_repo、クックブックの
ディレクトリを/tmp/chef_repo/site-cookbooks/test_cookbookとしています。

優先度 定義場所 ディレクトリフルパス
1 Nodeオブジェクト /tmp/chef_repo/nodes/node01.json
2 ロール /tmp/chef_repo/web.json
3 Environments /tmp/chef_repo/environments/development.json
4 レシピの中で定義されたAttribute /tmp/chef_repo/site-cookbooks/test_cookbook/recipes/default.rb
5 クックブック内のAttributeファイル /tmp/chef_repo/site-cookbooks/test_cookbook/attributes/defautl.rb
2
2
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
2
2