Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Please set three new environment variables for hammer bosh command. #9

Closed
Houlistonm opened this issue Aug 27, 2019 · 2 comments

Comments

@Houlistonm
Copy link
Contributor

We are experiencing an issue with the bosh-cli (cloudfoundry/bosh-cli#328) during the following command

hammer bosh -- -d cf-c965095e0afd2591daab ssh clock_global/52145b71-4b6a-44ba-8d46-d4361328f085

ssh returns

Running SSH:
  1 error occurred:
        * Running command: 'ssh -tt -o ServerAliveInterval=30 -o ForwardAgent=no -o PasswordAuthentication=no -o IdentitiesOnly=yes -o IdentityFile=/home/ec2-user/.bosh/tmp/ssh-priv-key750669365 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/home/ec2-user/.bosh/tmp/ssh-known-hosts168026640 -o ProxyCommand=nc -x 127.0.0.1:39601 %!h(MISSING) %!p(MISSING) 10.2.32.10 -l bosh_7542b2ed9bb54c8', stdout: '', stderr: '': exit status 255

Our work around is to set three new environment variables:

eval "$(hammer bosh)"
echo "export BOSH_GW_HOST=$( grep -Po '(?<=@)([^:]+)(?=:)' <<< $BOSH_ALL_PROXY )"
echo "export BOSH_GW_USER=$( grep -Po '(?<=://)([^@]+)(?=@)' <<< $BOSH_ALL_PROXY )"
echo "export BOSH_GW_PRIVATE_KEY=$( grep -Po '(?<=key=)(.*)' <<< $BOSH_ALL_PROXY )"

and then succesfully ssh to a vm with the following command.

hammer bosh -- -d cf-c965095e0afd2591daab ssh clock_global/52145b71-4b6a-44ba-8d46-d4361328f085 --gw-socks5=

The feature request is for the 'hammer bosh ...' command to set and/or output those three env variables depending on the command invocation.

@edwardecook
Copy link
Contributor

With the work for #10 (via #11) merged in this should be done, thanks again for the contributions!

I'll cut a release with this work later today.

@edwardecook
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants