Chef infra 什么';What’chef应用程序和chef repo之间的区别是什么

Chef infra 什么';What’chef应用程序和chef repo之间的区别是什么,chef-infra,chefdk,Chef Infra,Chefdk,我发现有两种方法可以生成chef repo,但我对它们的相似性感到困惑。我想知道哪一种是推荐的方法,为什么厨师会提供这些命令。也许它们在不同的上下文中使用 $ 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

我发现有两种方法可以生成chef repo,但我对它们的相似性感到困惑。我想知道哪一种是推荐的方法,为什么厨师会提供这些命令。也许它们在不同的上下文中使用

$ 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
$chef生成应用chef应用
$chef生成回购chef回购
$diff chef应用程序chef repo | colordiff
仅在chef应用程序中:.git
diff chef app/.gitignore chef repo/.gitignore
1,8c1
流浪汉
.rake\u测试\u缓存
10,16c3,7
<#捆扎机
 ###
>#忽略关键文件和机密
> ###
>.chef/*.pem
>.chef/加密的\u数据\u包\u机密
仅在chef应用程序中:.kitchen.yml
仅适用于chef repo:许可证
diff chef app/README.md chef repo/README.md
1c1,2
<#厨师应用程序
---
>概述
> ========
3c4
每个Chef安装都需要一个Chef存储库。这是使用Chef管理系统的食谱、角色、配置文件和其他工件所在的地方。我们强烈建议将此存储库存储在Git等版本控制系统中,并将其视为源代码。
4a6,66
>虽然我们更喜欢Git,并通过GitHub提供此存储库,但欢迎您下载tar或zip存档,并使用您最喜欢的版本控制系统来管理代码。
>
>存储库目录
> ======================
>
>该存储库包含多个目录,每个目录都包含一个自述文件,该文件更详细地描述了它的用途,以及如何使用它来使用Chef管理系统。
>
>*`certificates/`-由`rake SSL\u cert`生成的SSL证书位于此处。
>*`config/`-包含Rake配置文件`Rake.rb`。
>*`cookbooks/`-您下载或创建的烹饪书。
>*`data_bags/`-将数据包和项目存储在存储库的.json中。
>*`roles/`-将角色存储在存储库的.rb或.json中。
>
>耙任务
> ==========
>
>存储库包含一个“Rakefile”,其中包含随Chef库一起安装的任务。要查看存储库中可用的任务及其简要说明,请运行'rake-T'。
>
>默认任务(`default`)在不带参数的情况下执行`rake`时运行。它将调用任务“test_cookbooks”。
>
>以下任务不直接替换为刀子命令。
>
>*`bundle_cookbook[cookbook]`-在`pkgs/`dir中创建cookbook tarball。
>*`install`-调用`update`、`roles`和`upload\u cookbooks` Rake任务。
>*`ssl\u cert`-在`certificates/`dir中创建自签名ssl证书。
>*`update`-从源代码管理服务器更新存储库,了解git和svn。
>
>以下任务复制了刀子的功能,并可能在未来版本的Chef中删除。
>
>*`metadata`-替换为`刀子食谱元数据-a`。
>*`new_cookbook`-替换为`knife cookbook create`。
>*`role[role\u name]`-替换为`knife role from file`。
>*`roles`-迭代角色并使用`knife role from file`上载。
>*`test_cookbooks`-替换为`knife cookbook test-a`。
>*`test_cookbook[cookbook]`-替换为`knife cookbook test cookbook`。
>*`upload_cookbooks`-替换为`knife cookbook upload-a`。
>*`upload_cookbook[cookbook]`-替换为`knife cookbook upload cookbook`。
>
>配置
> =============
>
>存储库使用两个配置文件。
>
>*config/rake.rb
>*.chef/know.rb
>
>第一个,`config/rake.rb`将Rakefile配置为两个部分。
>
>*在“ssl_cert”任务中用于创建证书的常量。
>*设置各种任务中使用的目录位置的常量。
>
>如果使用'ssl_cert'任务,请适当更改'config/rake.rb'文件中的值。“new_cookbook”任务中也使用了这些值,但该任务被“knife cookbook create”命令取代,该命令可在下面进行配置。
>
>第二个配置文件`chef/knife.rb`是knife的特定于存储库的配置文件。如果您使用的是Opscode平台,则可以从管理控制台为您的组织下载一个平台。如果您使用的是开源Chef服务器,则可以使用“刀子配置”生成一个新的Chef服务器。有关配置刀的更多信息,请参阅刀文档。
>
> http://docs.opscode.com/knife.html
>
>下一步
> ==========
>
>阅读每个子目录中的自述文件,了解有关这些目录中的内容的更多信息。
仅在chef repo中:Rakefile
仅在chef repo中:证书
仅适用于chef repo:chefignore
仅在chef repo:config中
常见子目录:厨师应用程序/食谱和厨师回复/食谱
仅在chef repo中:数据包
仅在chef repo中:环境
仅在厨师回复中:角色

这个
repo
生成器是许多人从GitHub克隆出来的老
厨师repo
骨架的替代品。
app
生成器是一个小小的实验。它被设想为旧式单一回购协议布局和每个食谱都有自己的回购协议布局的中间点。
app
layout在一个git回购中有几个密切相关的烹饪书,但总体上仍有多个回购,重点放在烹饪书而不是角色/袋子上。

请不要在评论中提出新问题。好吧,我想这是公平的,但你至少也可以提供一个快速的建议,伙计。。。哦,嗯,nvm…我在这里找到了一个关于
generate app
vs
generate repo
vs
generate cookbook
的信息丰富的页面: