You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs on this are poor. It says that you use it to "Decrypt and download an encrypted file to the specified path." What it should point out is that it's the inverse of knife vault create --file FILENAME.
When you use --file to create a vault, it creates two keys in the vault item: file-name and file-content.
So knife vault download opens up the vault item, then writes whatever it finds in the file-content key to a file named using the file-name key. In your case these are presumably not found because you have free-form data in your vault.
To be honest, this is a subcommand that I'd like to kill off in v3.0, but for now there are a few ways to approach it:
Fix up the docs so people have a reasonable expectation of what it does
Have it throw a useful error if the vault doesn't have a file-content and file-name key
Probably a combination of both so the error points people to docs that explain it as I have above.
Is your use case to get the raw JSON of the vault? In that case, knife vault show VAULT ITEM -f json will do what you want.
If on the other hand you're trying to get the encrypted content for archival purposes, then knife download data_bags/VAULT/ITEM or knife data bag show VAULT ITEM -f json and knife data bag show VAULT ITEM_keys -f json are what you're looking for.
I'm using vault 2.6.1 with chef 12.2.1. For now I'm using
knife download data_bags/foo/
as pointed out by @jtimberman.The text was updated successfully, but these errors were encountered: