# Don't require to upload cookbooks not actually being used

**URL:** <https://discourse.chef.io/t/dont-require-to-upload-cookbooks-not-actually-being-used/5784>\
**Category:** Chef Infra (archive)\
**Created:** [September 9, 2014, 10:28am UTC](https://discourse.chef.io/t/dont-require-to-upload-cookbooks-not-actually-being-used/5784 "2014-09-09T10:28:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton\_Koldaev](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/anton_koldaev/32/91_2.png) [@Anton\_Koldaev](https://discourse.chef.io/u/Anton_Koldaev)\
**Post date:** [September 9, 2014, 10:28am UTC](https://discourse.chef.io/t/dont-require-to-upload-cookbooks-not-actually-being-used/5784/1 "2014-09-09T10:28:06Z")

</div>

Let's look at lita cookbook:

> **[litaio/chef-lita](https://github.com/litaio/chef-lita)**
>
> A Chef cookbook for installing Lita. Contribute to litaio/chef-lita development by creating an account on GitHub.

`grep depends metadata.rb`:  
depends 'apt'  
depends 'build-essential'  
depends 'ruby-ng', '~\> 0.1.1'  
depends 'redis2', '~\> 0.5.0'

However there is an option not to use ruby-ng and redis2 cookbooks, which  
is really useful since there are plenty of different 'ruby' and 'redis'  
cookbooks and cookbook developer should always let user use another  
cookbook to install dependencies.

# dependency install type:

# 

# - auto: let the cookbook try to figure it out

# - none: will be installed by other means and available in system path

# 

default["lita"]["ruby\_install\_type"] = "auto"  
default["lita"]["redis\_install\_type"] = "auto"

It doesn't make any sense to require those cookbooks to be uploaded to  
chef-server if I'm not going to use them:  
% knife cookbook upload lita  
Uploading lita [0.0.3]  
ERROR: Cookbook lita depends on cookbooks which are not currently  
ERROR: being uploaded and cannot be found on the server.  
ERROR: The missing cookbook(s) are: 'ruby-ng' version '~\> 0.1.1', 'redis2'  
version '~\> 0.5.0'

It's a common problem for most cookbooks. Is there a good way to work it  
around?

--  
Best regards,  
Koldaev Anton

---

<div class="post-metadata">

**Author:** ![brauliobo](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/brauliobo/32/109_2.png) [@brauliobo](https://discourse.chef.io/u/brauliobo)\
**Post date:** [September 9, 2014, 12:28pm UTC](https://discourse.chef.io/t/dont-require-to-upload-cookbooks-not-actually-being-used/5784/2 "2014-09-09T12:28:50Z")

</div>

+1 to a solution. Also, depends should be able to specify a git version, as  
in Berksfile

On Tue, Sep 9, 2014 at 7:28 AM, Anton Koldaev [koldaevav@gmail.com](mailto:koldaevav@gmail.com) wrote:

> Let's look at lita cookbook:  
> [GitHub - litaio/chef-lita: A Chef cookbook for installing Lita.](https://github.com/litaio/chef-lita)
> 
> `grep depends metadata.rb`:  
> depends 'apt'  
> depends 'build-essential'  
> depends 'ruby-ng', '~\> 0.1.1'  
> depends 'redis2', '~\> 0.5.0'
> 
> However there is an option not to use ruby-ng and redis2 cookbooks, which  
> is really useful since there are plenty of different 'ruby' and 'redis'  
> cookbooks and cookbook developer should always let user use another  
> cookbook to install dependencies.
> 
> # dependency install type:
> 
> # 
> 
> # - auto: let the cookbook try to figure it out
> 
> # - none: will be installed by other means and available in system path
> 
> # 
> 
> default["lita"]["ruby\_install\_type"] = "auto"  
> default["lita"]["redis\_install\_type"] = "auto"
> 
> It doesn't make any sense to require those cookbooks to be uploaded to  
> chef-server if I'm not going to use them:  
> % knife cookbook upload lita  
> Uploading lita [0.0.3]  
> ERROR: Cookbook lita depends on cookbooks which are not currently  
> ERROR: being uploaded and cannot be found on the server.  
> ERROR: The missing cookbook(s) are: 'ruby-ng' version '~\> 0.1.1', 'redis2'  
> version '~\> 0.5.0'
> 
> It's a common problem for most cookbooks. Is there a good way to work it  
> around?
> 
> --  
> Best regards,  
> Koldaev Anton

--  
"Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua  
ideologia. Morra por sua ideologia" P.R. Sarkar

EITA - Educação, Informação e Tecnologias para Autogestão

> **[Bráulio Bhavamitra](https://cirandas.net/brauliobo)**

> **[Cooperativa EITA](https://eita.coop.br/)**
>
> Educação, Informação e Tecnologias para Autogestão

"Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é meu  
lar e todos nós somos cidadãos deste cosmo. Este universo é a imaginação da  
Mente Macrocósmica, e todas as entidades estão sendo criadas, preservadas e  
destruídas nas fases de extroversão e introversão do fluxo imaginativo  
cósmico. No âmbito pessoal, quando uma pessoa imagina algo em sua mente,  
naquele momento, essa pessoa é a única proprietária daquilo que ela  
imagina, e ninguém mais. Quando um ser humano criado mentalmente caminha  
por um milharal também imaginado, a pessoa imaginada não é a propriedade  
desse milharal, pois ele pertence ao indivíduo que o está imaginando. Este  
universo foi criado na imaginação de Brahma, a Entidade Suprema, por isso  
a propriedade deste universo é de Brahma, e não dos microcosmos que também  
foram criados pela imaginação de Brahma. Nenhuma propriedade deste mundo,  
mutável ou imutável, pertence a um indivíduo em particular; tudo é o  
patrimônio comum de todos."  
Restante do texto em

> **[A problemática de hoje em dia - Bráulio Bhavamitra](https://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia)**
>
> "Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é meu lar e todos nós somos cidadãos deste cosmo. Este universo é a imaginação da Mente Macrocósmica, e todas as entidades estão sendo criadas, preservadas e destruídas nas fases de...

---

<div class="post-metadata">

**Author:** ![Eric\_Helgeson](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/eric_helgeson/32/67_2.png) [@Eric\_Helgeson](https://discourse.chef.io/u/Eric_Helgeson)\
**Post date:** [September 9, 2014, 12:47pm UTC](https://discourse.chef.io/t/dont-require-to-upload-cookbooks-not-actually-being-used/5784/3 "2014-09-09T12:47:54Z")

</div>

I believe this is what 'recommends' or 'suggests' is for in metadata.rb

[https://docs.getchef.com/essentials\_cookbook\_metadata.html](https://docs.getchef.com/essentials_cookbook_metadata.html)

"Adds a dependency on another cookbook that is recommended, but not  
required. A cookbook will still work even if recommended dependencies are  
not available."

As for specifying a git version, the cookbook is just saying what it needs,  
not where to get it. Thats what berks/librarian are for.

-Eric Helgeson  
@nulleric [https://twitter.com/nulleric](https://twitter.com/nulleric)  
​[http://usingchef.com​](http://usingchef.xn--com-7m0a)

2014-09-09 7:28 GMT-05:00 Bráulio Bhavamitra [brauliobo@gmail.com](mailto:brauliobo@gmail.com):

> +1 to a solution. Also, depends should be able to specify a git version,  
> as in Berksfile
> 
> On Tue, Sep 9, 2014 at 7:28 AM, Anton Koldaev [koldaevav@gmail.com](mailto:koldaevav@gmail.com) wrote:
> 
> > Let's look at lita cookbook:  
> > [GitHub - litaio/chef-lita: A Chef cookbook for installing Lita.](https://github.com/litaio/chef-lita)
> > 
> > `grep depends metadata.rb`:  
> > depends 'apt'  
> > depends 'build-essential'  
> > depends 'ruby-ng', '~\> 0.1.1'  
> > depends 'redis2', '~\> 0.5.0'
> > 
> > However there is an option not to use ruby-ng and redis2 cookbooks, which  
> > is really useful since there are plenty of different 'ruby' and 'redis'  
> > cookbooks and cookbook developer should always let user use another  
> > cookbook to install dependencies.
> > 
> > # dependency install type:
> > 
> > # 
> > 
> > # - auto: let the cookbook try to figure it out
> > 
> > # - none: will be installed by other means and available in system path
> > 
> > # 
> > 
> > default["lita"]["ruby\_install\_type"] = "auto"  
> > default["lita"]["redis\_install\_type"] = "auto"
> > 
> > It doesn't make any sense to require those cookbooks to be uploaded to  
> > chef-server if I'm not going to use them:  
> > % knife cookbook upload lita  
> > Uploading lita [0.0.3]  
> > ERROR: Cookbook lita depends on cookbooks which are not currently  
> > ERROR: being uploaded and cannot be found on the server.  
> > ERROR: The missing cookbook(s) are: 'ruby-ng' version '~\> 0.1.1',  
> > 'redis2' version '~\> 0.5.0'
> > 
> > It's a common problem for most cookbooks. Is there a good way to work it  
> > around?
> > 
> > --  
> > Best regards,  
> > Koldaev Anton
> 
> --  
> "Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua  
> ideologia. Morra por sua ideologia" P.R. Sarkar
> 
> EITA - Educação, Informação e Tecnologias para Autogestão  
> [Blog - Bráulio Bhavamitra](http://cirandas.net/brauliobo)  
> [http://eita.org.br](http://eita.org.br)
> 
> "Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é meu  
> lar e todos nós somos cidadãos deste cosmo. Este universo é a imaginação da  
> Mente Macrocósmica, e todas as entidades estão sendo criadas, preservadas e  
> destruídas nas fases de extroversão e introversão do fluxo imaginativo  
> cósmico. No âmbito pessoal, quando uma pessoa imagina algo em sua mente,  
> naquele momento, essa pessoa é a única proprietária daquilo que ela  
> imagina, e ninguém mais. Quando um ser humano criado mentalmente caminha  
> por um milharal também imaginado, a pessoa imaginada não é a propriedade  
> desse milharal, pois ele pertence ao indivíduo que o está imaginando. Este  
> universo foi criado na imaginação de Brahma, a Entidade Suprema, por isso  
> a propriedade deste universo é de Brahma, e não dos microcosmos que também  
> foram criados pela imaginação de Brahma. Nenhuma propriedade deste mundo,  
> mutável ou imutável, pertence a um indivíduo em particular; tudo é o  
> patrimônio comum de todos."  
> Restante do texto em  
> [A problemática de hoje em dia - Bráulio Bhavamitra](http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia)

---

<div class="post-metadata">

**Author:** ![Brian\_Pitts](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/brian_pitts/32/216_2.png) [@Brian\_Pitts](https://discourse.chef.io/u/Brian_Pitts)\
**Post date:** [September 9, 2014, 3:08pm UTC](https://discourse.chef.io/t/dont-require-to-upload-cookbooks-not-actually-being-used/5784/4 "2014-09-09T15:08:03Z")

</div>

If you're using berkshelf to manage dependencies, does the use of  
'recommends' and 'suggests' help? I thought it treated them as  
equivalent to 'depends'.

On Tue, Sep 9, 2014 at 7:47 AM, Eric Helgeson [erichelgeson@gmail.com](mailto:erichelgeson@gmail.com) wrote:

> I believe this is what 'recommends' or 'suggests' is for in metadata.rb
> 
> [https://docs.getchef.com/essentials\_cookbook\_metadata.html](https://docs.getchef.com/essentials_cookbook_metadata.html)
> 
> "Adds a dependency on another cookbook that is recommended, but not  
> required. A cookbook will still work even if recommended dependencies are  
> not available."
> 
> As for specifying a git version, the cookbook is just saying what it needs,  
> not where to get it. Thats what berks/librarian are for.
> 
> -Eric Helgeson  
> @nulleric  
> [http://usingchef.com](http://usingchef.com)
> 
> 2014-09-09 7:28 GMT-05:00 Bráulio Bhavamitra [brauliobo@gmail.com](mailto:brauliobo@gmail.com):
> 
> > +1 to a solution. Also, depends should be able to specify a git version,  
> > as in Berksfile
> > 
> > On Tue, Sep 9, 2014 at 7:28 AM, Anton Koldaev [koldaevav@gmail.com](mailto:koldaevav@gmail.com) wrote:
> > 
> > > Let's look at lita cookbook:  
> > > [GitHub - litaio/chef-lita: A Chef cookbook for installing Lita.](https://github.com/litaio/chef-lita)
> > > 
> > > `grep depends metadata.rb`:  
> > > depends 'apt'  
> > > depends 'build-essential'  
> > > depends 'ruby-ng', '~\> 0.1.1'  
> > > depends 'redis2', '~\> 0.5.0'
> > > 
> > > However there is an option not to use ruby-ng and redis2 cookbooks, which  
> > > is really useful since there are plenty of different 'ruby' and 'redis'  
> > > cookbooks and cookbook developer should always let user use another cookbook  
> > > to install dependencies.
> > > 
> > > # dependency install type:
> > > 
> > > # 
> > > 
> > > # - auto: let the cookbook try to figure it out
> > > 
> > > # - none: will be installed by other means and available in system path
> > > 
> > > # 
> > > 
> > > default["lita"]["ruby\_install\_type"] = "auto"  
> > > default["lita"]["redis\_install\_type"] = "auto"
> > > 
> > > It doesn't make any sense to require those cookbooks to be uploaded to  
> > > chef-server if I'm not going to use them:  
> > > % knife cookbook upload lita  
> > > Uploading lita [0.0.3]  
> > > ERROR: Cookbook lita depends on cookbooks which are not currently  
> > > ERROR: being uploaded and cannot be found on the server.  
> > > ERROR: The missing cookbook(s) are: 'ruby-ng' version '~\> 0.1.1',  
> > > 'redis2' version '~\> 0.5.0'
> > > 
> > > It's a common problem for most cookbooks. Is there a good way to work it  
> > > around?
> > > 
> > > --  
> > > Best regards,  
> > > Koldaev Anton
> > 
> > --  
> > "Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua  
> > ideologia. Morra por sua ideologia" P.R. Sarkar
> > 
> > EITA - Educação, Informação e Tecnologias para Autogestão  
> > [Blog - Bráulio Bhavamitra](http://cirandas.net/brauliobo)  
> > [http://eita.org.br](http://eita.org.br)
> > 
> > "Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é meu  
> > lar e todos nós somos cidadãos deste cosmo. Este universo é a imaginação da  
> > Mente Macrocósmica, e todas as entidades estão sendo criadas, preservadas e  
> > destruídas nas fases de extroversão e introversão do fluxo imaginativo  
> > cósmico. No âmbito pessoal, quando uma pessoa imagina algo em sua mente,  
> > naquele momento, essa pessoa é a única proprietária daquilo que ela imagina,  
> > e ninguém mais. Quando um ser humano criado mentalmente caminha por um  
> > milharal também imaginado, a pessoa imaginada não é a propriedade desse  
> > milharal, pois ele pertence ao indivíduo que o está imaginando. Este  
> > universo foi criado na imaginação de Brahma, a Entidade Suprema, por isso a  
> > propriedade deste universo é de Brahma, e não dos microcosmos que também  
> > foram criados pela imaginação de Brahma. Nenhuma propriedade deste mundo,  
> > mutável ou imutável, pertence a um indivíduo em particular; tudo é o  
> > patrimônio comum de todos."  
> > Restante do texto em  
> > [A problemática de hoje em dia - Bráulio Bhavamitra](http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia)

--  
Brian Pitts  
Web Operations Engineer

---

<div class="post-metadata">

**Author:** ![Eric\_Helgeson](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/eric_helgeson/32/67_2.png) [@Eric\_Helgeson](https://discourse.chef.io/u/Eric_Helgeson)\
**Post date:** [September 9, 2014, 4:14pm UTC](https://discourse.chef.io/t/dont-require-to-upload-cookbooks-not-actually-being-used/5784/5 "2014-09-09T16:14:33Z")

</div>

Brian, you're correct, Berks will resolve them all, so if you're doing  
berks upload you'll get suggested and recommends. See this for more details  
on rational: [Flag to skip "recommends" dependencies · Issue #895 · berkshelf/berkshelf · GitHub](https://github.com/berkshelf/berkshelf/issues/895)

-Eric Helgeson  
@nulleric [https://twitter.com/nulleric](https://twitter.com/nulleric)

On Tue, Sep 9, 2014 at 10:08 AM, Brian Pitts [brian.pitts@lonelyplanet.com](mailto:brian.pitts@lonelyplanet.com)  
wrote:

> If you're using berkshelf to manage dependencies, does the use of  
> 'recommends' and 'suggests' help? I thought it treated them as  
> equivalent to 'depends'.
> 
> On Tue, Sep 9, 2014 at 7:47 AM, Eric Helgeson [erichelgeson@gmail.com](mailto:erichelgeson@gmail.com)  
> wrote:
> 
> > I believe this is what 'recommends' or 'suggests' is for in metadata.rb
> > 
> > [https://docs.getchef.com/essentials\_cookbook\_metadata.html](https://docs.getchef.com/essentials_cookbook_metadata.html)
> > 
> > "Adds a dependency on another cookbook that is recommended, but not  
> > required. A cookbook will still work even if recommended dependencies are  
> > not available."
> > 
> > As for specifying a git version, the cookbook is just saying what it  
> > needs,  
> > not where to get it. Thats what berks/librarian are for.
> > 
> > -Eric Helgeson  
> > @nulleric  
> > [http://usingchef.com](http://usingchef.com)
> > 
> > 2014-09-09 7:28 GMT-05:00 Bráulio Bhavamitra [brauliobo@gmail.com](mailto:brauliobo@gmail.com):
> > 
> > > +1 to a solution. Also, depends should be able to specify a git version,  
> > > as in Berksfile
> > > 
> > > On Tue, Sep 9, 2014 at 7:28 AM, Anton Koldaev [koldaevav@gmail.com](mailto:koldaevav@gmail.com)  
> > > wrote:
> > > 
> > > > Let's look at lita cookbook:  
> > > > [GitHub - litaio/chef-lita: A Chef cookbook for installing Lita.](https://github.com/litaio/chef-lita)
> > > > 
> > > > `grep depends metadata.rb`:  
> > > > depends 'apt'  
> > > > depends 'build-essential'  
> > > > depends 'ruby-ng', '~\> 0.1.1'  
> > > > depends 'redis2', '~\> 0.5.0'
> > > > 
> > > > However there is an option not to use ruby-ng and redis2 cookbooks,  
> > > > which  
> > > > is really useful since there are plenty of different 'ruby' and 'redis'  
> > > > cookbooks and cookbook developer should always let user use another  
> > > > cookbook  
> > > > to install dependencies.
> > > > 
> > > > # dependency install type:
> > > > 
> > > > # 
> > > > 
> > > > # - auto: let the cookbook try to figure it out
> > > > 
> > > > # - none: will be installed by other means and available in system path
> > > > 
> > > > # 
> > > > 
> > > > default["lita"]["ruby\_install\_type"] = "auto"  
> > > > default["lita"]["redis\_install\_type"] = "auto"
> > > > 
> > > > It doesn't make any sense to require those cookbooks to be uploaded to  
> > > > chef-server if I'm not going to use them:  
> > > > % knife cookbook upload lita  
> > > > Uploading lita [0.0.3]  
> > > > ERROR: Cookbook lita depends on cookbooks which are not currently  
> > > > ERROR: being uploaded and cannot be found on the server.  
> > > > ERROR: The missing cookbook(s) are: 'ruby-ng' version '~\> 0.1.1',  
> > > > 'redis2' version '~\> 0.5.0'
> > > > 
> > > > It's a common problem for most cookbooks. Is there a good way to work  
> > > > it  
> > > > around?
> > > > 
> > > > --  
> > > > Best regards,  
> > > > Koldaev Anton
> > > 
> > > --  
> > > "Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua  
> > > ideologia. Morra por sua ideologia" P.R. Sarkar
> > > 
> > > EITA - Educação, Informação e Tecnologias para Autogestão  
> > > [Blog - Bráulio Bhavamitra](http://cirandas.net/brauliobo)  
> > > [http://eita.org.br](http://eita.org.br)
> > > 
> > > "Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é meu  
> > > lar e todos nós somos cidadãos deste cosmo. Este universo é a  
> > > imaginação da  
> > > Mente Macrocósmica, e todas as entidades estão sendo criadas,  
> > > preservadas e  
> > > destruídas nas fases de extroversão e introversão do fluxo imaginativo  
> > > cósmico. No âmbito pessoal, quando uma pessoa imagina algo em sua mente,  
> > > naquele momento, essa pessoa é a única proprietária daquilo que ela  
> > > imagina,  
> > > e ninguém mais. Quando um ser humano criado mentalmente caminha por um  
> > > milharal também imaginado, a pessoa imaginada não é a propriedade desse  
> > > milharal, pois ele pertence ao indivíduo que o está imaginando. Este  
> > > universo foi criado na imaginação de Brahma, a Entidade Suprema, por  
> > > isso a  
> > > propriedade deste universo é de Brahma, e não dos microcosmos que também  
> > > foram criados pela imaginação de Brahma. Nenhuma propriedade deste  
> > > mundo,  
> > > mutável ou imutável, pertence a um indivíduo em particular; tudo é o  
> > > patrimônio comum de todos."  
> > > Restante do texto em  
> > > [A problemática de hoje em dia - Bráulio Bhavamitra](http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia)
> 
> --  
> Brian Pitts  
> Web Operations Engineer
