简体   繁体   中英

Downloading chef vault file using recipe

I have a chef vault item storing a private key which I have created using

knife vault create keys private --file user.pem

I can query this using

knife vaullt show keys private

In one of my recipe I want to download this file on the client. I saw this method to load the vault items but this would not download the file as is.

vault_item = ChefVault::Item.load(vaultname, itemname)

How can I download user.pem in a specified location on my node? Basically I am looking for recipe equivalent of knife vault download VAULT ITEM /path/to/file command on workstation.I probably would have load it in a variable and then write in a file using a ruby library but not sure if that is a good way to handle .pem files. I also have .crt file which I have to store and download from vault.

该文件最终在Vault项目中以base64编码的blob结尾,您可以使用file资源将其写入磁盘并设置权限和所有爵士乐。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM