2015-01-23 3 views
10

요리사 레포를 생성하는 2 가지 방법이 있으며 그 유사점을 혼동하는 것으로 나타났습니다. 나는 어느 쪽이 추천 된 길인지, 그리고 왜 요리사가 그 명령을 제공하는지 궁금해. 어쩌면 그들은 다른 맥락에서 사용됩니까?요리사 앱과 요리사 레포의 차이점

$ chef generate app chef-app 
$ chef generate repo chef-repo 
$ diff chef-app chef-repo | colordiff 
Only in chef-app: .git 
diff chef-app/.gitignore chef-repo/.gitignore 
1,8c1 
< .vagrant 
< Berksfile.lock 
< *~ 
< *# 
< .#* 
< \#*# 
< .*.sw[a-z] 
< *.un~ 
--- 
> .rake_test_cache 
10,16c3,7 
< # Bundler 
< Gemfile.lock 
< bin/* 
< .bundle/* 
< 
< .kitchen/ 
< .kitchen.local.yml 
--- 
> ### 
> # Ignore Chef key files and secrets 
> ### 
> .chef/*.pem 
> .chef/encrypted_data_bag_secret 
Only in chef-app: .kitchen.yml 
Only in chef-repo: LICENSE 
diff chef-app/README.md chef-repo/README.md 
1c1,2 
< # chef-app 
--- 
> Overview 
> ======== 
3c4 
< TODO: Enter the cookbook description here. 
--- 
> Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code. 
4a6,66 
> While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code. 
> 
> Repository Directories 
> ====================== 
> 
> This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef. 
> 
> * `certificates/` - SSL certificates generated by `rake ssl_cert` live here. 
> * `config/` - Contains the Rake configuration file, `rake.rb`. 
> * `cookbooks/` - Cookbooks you download or create. 
> * `data_bags/` - Store data bags and items in .json in the repository. 
> * `roles/` - Store roles in .rb or .json in the repository. 
> 
> Rake Tasks 
> ========== 
> 
> The repository contains a `Rakefile` that includes tasks that are installed with the Chef libraries. To view the tasks available with in the repository with a brief description, run `rake -T`. 
> 
> The default task (`default`) is run when executing `rake` with no arguments. It will call the task `test_cookbooks`. 
> 
> The following tasks are not directly replaced by knife sub-commands. 
> 
> * `bundle_cookbook[cookbook]` - Creates cookbook tarballs in the `pkgs/` dir. 
> * `install` - Calls `update`, `roles` and `upload_cookbooks` Rake tasks. 
> * `ssl_cert` - Create self-signed SSL certificates in `certificates/` dir. 
> * `update` - Update the repository from source control server, understands git and svn. 
> 
> The following tasks duplicate functionality from knife and may be removed in a future version of Chef. 
> 
> * `metadata` - replaced by `knife cookbook metadata -a`. 
> * `new_cookbook` - replaced by `knife cookbook create`. 
> * `role[role_name]` - replaced by `knife role from file`. 
> * `roles` - iterates over the roles and uploads with `knife role from file`. 
> * `test_cookbooks` - replaced by `knife cookbook test -a`. 
> * `test_cookbook[cookbook]` - replaced by `knife cookbook test COOKBOOK`. 
> * `upload_cookbooks` - replaced by `knife cookbook upload -a`. 
> * `upload_cookbook[cookbook]` - replaced by `knife cookbook upload COOKBOOK`. 
> 
> Configuration 
> ============= 
> 
> The repository uses two configuration files. 
> 
> * config/rake.rb 
> * .chef/knife.rb 
> 
> The first, `config/rake.rb` configures the Rakefile in two sections. 
> 
> * Constants used in the `ssl_cert` task for creating the certificates. 
> * Constants that set the directory locations used in various tasks. 
> 
> If you use the `ssl_cert` task, change the values in the `config/rake.rb` file appropriately. These values were also used in the `new_cookbook` task, but that task is replaced by the `knife cookbook create` command which can be configured below. 
> 
> The second config file, `.chef/knife.rb` is a repository specific configuration file for knife. If you're using the Opscode Platform, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation. 
> 
> http://docs.opscode.com/knife.html 
> 
> Next Steps 
> ========== 
> 
> Read the README file in each of the subdirectories for more information about what goes in those directories. 
Only in chef-repo: Rakefile 
Only in chef-repo: certificates 
Only in chef-repo: chefignore 
Only in chef-repo: config 
Common subdirectories: chef-app/cookbooks and chef-repo/cookbooks 
Only in chef-repo: data_bags 
Only in chef-repo: environments 
Only in chef-repo: roles 
+1

나는'generate app' 대'generate repo' 대''cookbook 생성 '에 대한 매우 유익한 페이지를 찾았습니다 : http://devopsguru.tumblr.com/post/147717124737/chef-generate-app-vs-chef-check- generate-cookbook-vs –

답변

9

repo 발생기는 많은 사람들이 GitHub의에서 복제 이전 chef-repo 골격 대체합니다. app 생성기는 약간의 실험입니다. 예전 스타일의 단일 레포 레이아웃과 Berkshelf-heavy의 모든 요리 책 - 자체 - 레포 레이아웃 사이의 중간 지점으로 계획되었습니다. app 레이아웃은 하나의 git repo에 밀접하게 관련된 여러 요리 책을 가지고 있지만, 전체적으로 여러 repos와 역할/가방 이상의 요리 책에 중점을두고 있습니다.

+0

의견에 새로운 질문을하지 마십시오. – coderanger

+0

괜찮 았어, 내 생각 엔,하지만 너는 최소한 빠른 조언을 해줄 수 있었을거야. oh well, nvm ... – gsaslis