title: Bitbucket Pipeline how to setup ssh agent to deploy on a remote server
body: <p>Here is the workflow I want to achieve:</p>
  
  <ol>
  <li>commit code</li>
  <li>bitbucket pipeline run test on my public docker image</li>
  <li>bitbucket pipeline executes ansible script to deploy on my public docker image</li>
  </ol>
  
  <p>The first 2 steps working fine, but here is the problem:
  How/Where should I store my private keys to allow ansible to ssh to my remote server via ssh agent?</p>
  
  <p>I am a bit reluctant to store the private key inside Pipeline env settings, since everyone else has admin access to the repo can see it.</p>
  
  <p>There is a similar question asked <a href="https://stackoverflow.com/questions/37473376/ssh-into-staging-machine-from-docker-instance-using-bitbucket-pipelines">here</a> but the answer suggests to setup the keys on docker and use private repo, which it's a bit different to mine.</p>