title: Problem with executing "ssh-add" or eval 'ssh-agent' using Chef
body: <p>I am trying to add private keys to an Amazon Linux box using Chef. The key is in s3, and I copy it over to the directory. Then I start the ssh-agent using "eval <code>ssh-agent</code>". Everything is good until the "ssh-add" section = it errors with "<em>Could not open a connection to your authentication agent.</em>". So it seems that eval ssh-agent didn't start.</p>
  
  <pre><code>execute "sudo aws s3 cp --region us-east-1 s3://xxxx/keyname ~/.ssh/keyname"
  execute "eval `ssh-agent`" 
  execute "ssh-add ~/.ssh/keyname" &lt;--this is where it fails 
  </code></pre>
  
  <p>I've verified that the key is there. I've also tried to do the steps manually by connecting to the box and running the commands - and it works. </p>
  
  <p>But when it's in CHEF it fails. </p>
  
  <p>Here is the error log if it helps: </p>
  
  <pre><code>================================================================================
  Error executing action `run` on resource 'execute[ssh-add ~/.ssh/keyname]'
  ================================================================================
  
  Mixlib::ShellOut::ShellCommandFailed
  ------------------------------------
  Expected process to exit with [0], but received '2'
  ---- Begin output of ssh-add ~/.ssh/keyname ----
  STDOUT: 
  STDERR: Could not open a connection to your authentication agent.
  ---- End output of ssh-add ~/.ssh/keyname ----
  Ran ssh-add ~/.ssh/keyname returned 2
  </code></pre>
  
  <p>I've hit a wall and any help is appreciated. </p>