包括另一本食谱中的厨师LWRP [英] Including a Chef LWRP from another cookbook

查看:88
本文介绍了包括另一本食谱中的厨师LWRP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在app菜谱(trim_log)上写了一个小型LWRP,它可以正常工作.但是,现在我正在尝试将特定的LWRP移到commons食谱中,以便我的其他食谱也可以使用它.问题是我无法弄清楚如何在trim_log资源/提供程序中加载任何食谱,包括我的app食谱.

I wrote a small LWRP my app cookbook (trim_log), and it works. However, now I am trying to move this particular LWRP in to the commons cookbook so that my other cookbooks can also use it. The problem is that I cannot figure out how to load in the trim_log resource/provider in to any of the cookbooks, including my app cookbook.

├── app
│   ├── recipes
│       └── default.rb
├── commons
   ├── providers
   │   └── trim_log.rb
   └── resources
       └── trim_log.rb

我在公共食谱中定义了trim_log提供程序/资源.现在,我希望在app食谱中使用此trim_log提供程序/资源.我如何在那里提供它?

I have defined the trim_log provider/resource in the commons cookbook. Now I wish to use this trim_log provider/resource in the app cookbook. How can I make it available there?

推荐答案

我相信您需要:

  • app/metadata.rb中声明您依赖于commons食谱.
  • app/recipes/default.rb中将资源引用为commons_trim_log.
  • Declare in the app/metadata.rb that you depend on the commons cookbook.
  • Refer to the resource as commons_trim_log in app/recipes/default.rb.

这篇关于包括另一本食谱中的厨师LWRP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆