How do I share code across Chef cookbooks in a chef-repo?

前端 未结 2 888
轻奢々
轻奢々 2021-02-13 23:13

I would like to share a small handful of methods across recipes in a chef repo. I know that on a cookbook level I can put code in modules in the libraries directory (see relate

2条回答
  •  旧时难觅i
    2021-02-13 23:35

    There are 3 distinct options allowing for sharing code in form of either chef resource (1. LWRP, 2. HWRP) or methods (3. "libraries"). I'd suggest you consider LWRPs first. I find this answer very good in explaining differences between mentioned techniques.

提交回复
热议问题