# Use library-recipe 2 times on 1 node

**URL:** <https://discourse.chef.io/t/use-library-recipe-2-times-on-1-node/8714>\
**Category:** Chef Infra (archive)\
**Created:** [June 16, 2016, 9:27am UTC](https://discourse.chef.io/t/use-library-recipe-2-times-on-1-node/8714 "2016-06-16T09:27:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian.leinweber](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@christian.leinweber](https://discourse.chef.io/u/christian.leinweber)\
**Post date:** [June 16, 2016, 9:27am UTC](https://discourse.chef.io/t/use-library-recipe-2-times-on-1-node/8714/1 "2016-06-16T09:27:15Z")

</div>

Hi,

i have the following problem:

i have one git repo with a common recipe called DeployService. This contains multiple steps to deploy a selfcoded service on a windows machine. We have a lot of such services.

Now i create in another git repo an “application cookbook” or “wrapper cookbook”. This reference the Deployservice cookbook.

In the app cookbook i build 2 recipes. Both of them calls them with “include\_recipe DeployService” and set with node.override attributes for this specific service. Like this:

service1\_recipe:  
- set attributes for service 1  
- include\_recipe DeployService

service2\_recipe:  
- set attributes for service 2  
- include\_recipe DeployService

I try to apply both of them to the same node with kitchen. But it seems that kitchen runs the deployservice recipe only one time.

I cannot find the problem. Can you help me? Thanks

regards  
Christian

---

<div class="post-metadata">

**Author:** ![chris\_sullivan](https://avatars.discourse-cdn.com/v4/letter/c/bc79bd/32.png) [@chris\_sullivan](https://discourse.chef.io/u/chris_sullivan)\
**Post date:** [June 16, 2016, 3:22pm UTC](https://discourse.chef.io/t/use-library-recipe-2-times-on-1-node/8714/2 "2016-06-16T15:22:07Z")

</div>

Hi Christian,

If I understand correctly you want to use the same recipe twice in a Chef run but with different attribute values setting the resources contained in that recipe?

Unfortunately this is not possible and is documented here [https://docs.chef.io/recipes.html](https://docs.chef.io/recipes.html) (go to “Include Recipes”).

Your best options are to turn your code into a definition or custom resource.

Good luck.
