bosh-cli: bosh interpolate doesn't properly handle env variables with new line

export TEST_ca_cert=$(read certificate from somewhere)

bosh interpolate file.yml --vars-env TEST

Output is:

ca_cert: '-----BEGIN CERTIFICATE----- MIIDEzCCAfugAwIBA ....'

Expected output:

ca_cert: |
          -----BEGIN CERTIFICATE-----
          MIIDEzCCAfugAwIBA
....

We use latest bosh cli.

bosh --version
version 2.0.26-105157c-2017-06-22T18:53:53Z

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@olle-brkt you should be able to use —var-file private_key=<(vault read …)

Sent from my iPhone

On Jan 8, 2018, at 7:59 PM, olle-brkt notifications@github.com wrote:

Also seeing this 😦

This is kind of annoying because having to save your secrets to files on your local machine kind of defeats the point of using these features.

bosh -d test deploy a.yml -v “private_key=$(vault read -field value /private_key)”

becomes something like: echo “$(vault read -field value /private_key)” > /tmp/private_key bosh -d test deploy a.yml --vars-file “private_key=/tmp/private_key” rm /tmp/private_key

which works, but could be less secure since if something goes wrong. if whatever clean up command/tool you have fails, you are left with a secret on your machine 😦

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.