# How to download privately listed package using chef habitat cookbook?

**URL:** <https://discourse.chef.io/t/how-to-download-privately-listed-package-using-chef-habitat-cookbook/18688>\
**Category:** Habitat Help\
**Created:** [June 9, 2018, 2:47pm UTC](https://discourse.chef.io/t/how-to-download-privately-listed-package-using-chef-habitat-cookbook/18688 "2018-06-09T14:47:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Hummingbird](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Steve\_Hummingbird](https://discourse.chef.io/u/Steve_Hummingbird)\
**Post date:** [June 9, 2018, 2:47pm UTC](https://discourse.chef.io/t/how-to-download-privately-listed-package-using-chef-habitat-cookbook/18688/1 "2018-06-09T14:47:10Z")

</div>

I have built a package that I uploaded to a private organisation.

When trying to make use of the habitat cookbook [https://github.com/chef-cookbooks/habitat](https://github.com/chef-cookbooks/habitat) and try to install that package using `hab_package`, the chef run fails with `No candidate version available for myorigin/mypackage`

I was not able to resolve this issue, however I very much suspect that this is related to a missing token, to authorise the download from the private organisation. If I publish the package as public, then everything works.

I tried to set the token using a statement like this before the `hab_package` statement:  
`ENV['HAB_AUTH_TOKEN'] = '_mytoken'`  
however that did not change anything.

Does anyone currently use chef to setup the supervisor deploying a private package and know how that should be done?

---

<div class="post-metadata">

**Author:** ![Steve\_Hummingbird](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Steve\_Hummingbird](https://discourse.chef.io/u/Steve_Hummingbird)\
**Post date:** [June 11, 2018, 8:48am UTC](https://discourse.chef.io/t/how-to-download-privately-listed-package-using-chef-habitat-cookbook/18688/2 "2018-06-11T08:48:25Z")

</div>

after some more digging, I think the answer is this is not (yet) supported by the cookbook.  
Setting the system property probably does not work because the hab command might be executed as another user (not 100% sure here though)

So to work around that I guess there are three options:

- setup the hab user manually and provide the necessary configs (cli.toml should probably be enough)
- use the execute resource to install hab packages and provide the token here
- fix it in the cookbook. (which should probably not be too difficult, but yet I would like to get some feedback here first, as I am certainly no chef expert)

---

<div class="post-metadata">

**Author:** ![eeyun1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/eeyun1/32/2658_2.png) [@eeyun1](https://discourse.chef.io/u/eeyun1)\
**Post date:** [June 11, 2018, 2:42pm UTC](https://discourse.chef.io/t/how-to-download-privately-listed-package-using-chef-habitat-cookbook/18688/3 "2018-06-11T14:42:04Z")

</div>

@jtimberman do you or the other maintainers of the hab cookbook have any suggestions on this one? I haven’t attempted/tested this myself. I might get some time this week to take a look and see what makes sense but if any of yall know off the top of your head that would be 👍

---

<div class="post-metadata">

**Author:** ![Steve\_Hummingbird](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Steve\_Hummingbird](https://discourse.chef.io/u/Steve_Hummingbird)\
**Post date:** [June 13, 2018, 2:51pm UTC](https://discourse.chef.io/t/how-to-download-privately-listed-package-using-chef-habitat-cookbook/18688/4 "2018-06-13T14:51:26Z")

</div>

Hmm, looks like @jtimberman hasn’t been active here for quite some time. Should I open an issue over at the repo?

---

<div class="post-metadata">

**Author:** ![eeyun1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/eeyun1/32/2658_2.png) [@eeyun1](https://discourse.chef.io/u/eeyun1)\
**Post date:** [June 13, 2018, 3:08pm UTC](https://discourse.chef.io/t/how-to-download-privately-listed-package-using-chef-habitat-cookbook/18688/5 "2018-06-13T15:08:44Z")

</div>

Might be a good idea. The hab dev team doesn’t maintain that cookbook. I did reach out to joshua this morning to see if he had any ideas. But, opening an issue there might be more direct.

---

<div class="post-metadata">

**Author:** ![Steve\_Hummingbird](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Steve\_Hummingbird](https://discourse.chef.io/u/Steve_Hummingbird)\
**Post date:** [June 13, 2018, 5:46pm UTC](https://discourse.chef.io/t/how-to-download-privately-listed-package-using-chef-habitat-cookbook/18688/6 "2018-06-13T17:46:01Z")

</div>

Great thanks. seems to be the best place for now 🙂[https://github.com/chef-cookbooks/habitat/issues/102](https://github.com/chef-cookbooks/habitat/issues/102)
