1

Here is the call I am making in my recipe:

mypassword = chef_vault_item("passwords", "default_pass")

Here is the error I am getting when running a kitchen converge on this recipe:

         Net::HTTPServerException
     ------------------------
     404 "Not Found"

What do I need to do to allow kitchen to access this vault item?

weevil
  • 56
  • 6

2 Answers2

2

Make sure you configure data_bags_path or put your files in the default location (data_bags/). The error mentions a server so you aren't use the default solo-based provisioner, but it would help to state which you are using.

coderanger
  • 52,400
  • 4
  • 52
  • 75
  • I am using the chef_zero provisioner. I was able to get it to converge successfully by adding a data_bag under ./test/integration/default/data_bags in my cookbook directory. I'm still not able to retrieve the value in a recipe though. How do I access the value? – weevil Jan 11 '16 at 17:42
2

I was informed by someone at Chef that chef_vault_item does not support encrypted data bags. You need to add dummy values as unencrypted data bags for testing purposes so your unencrypted passwords are not being checked into version control. The unencrypted data bag needs to be created in your chef repo under:

cookbooks/<cookbook name>/test/integration/default/data_bags/<vault name>/<item name>.json

in order for kitchen to successfully converge

weevil
  • 56
  • 6
  • that worked for me.. I would also suggest adding this line to the `.gitignore` file... `test/integration/default/data_bags/*` – TechDawg270 Feb 09 '17 at 22:19