title: Vagrant puppet - unable to run composer install with private repository
body: <p>So basically my issue is very similar to this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/20252553/vagrant-puppet-unable-to-run-composer-install-with-private-repository">Vagrant + Puppet: Unable to run composer install with private repository</a></p>
  
  <p>I am trying to get composer to install deployed applications on a Ubuntu 12.04 box using puppet.</p>
  
  <p>One of the packages I am trying to install as part of the composer run requires a deployment key. As part of the puppet run I have copied the deployment key (private, public and authorized and known_hosts) accross to the vagrant users home directory (<code>/home/vagrant/.ssh/</code>)</p>
  
  <p>This is where my question differs from the referenced question in that security is not a concern nor is multiple OS compatability for this build so i am happy to copy the keys over to the box and I have done...</p>
  
  <p>I have also loaded this key in the users .profile so that if I ssh into the machine I can run a composer install and everything runs just fine. The problem is i would like to have the apps install as part of the puppet run and I'm struggling to get this to work (everything installs until it gets to the one package which requires the deployment key).</p>
  
  <p>My <code>composer.json</code> currently contains this (current attempt to get it working):</p>
  
  <pre><code>"repositories": [
          {
              "type": "vcs",
              "url": "ssh://git@bitbucket.org/account/subrepo.git",
              "options": {
                  "ssh2": {
                      "username": "git",
                      "pubkey_file": "/home/vagrant/.ssh/key.pub",
                      "privkey_file": "/home/vagrant/.ssh/key"
                  }
              }
          }
      ],
  </code></pre>
  
  <p>My puppet run pulls the repos from git using vcsrepo (which allows you to pass a key in):</p>
  
  <pre><code>vcsrepo { "/var/www/site.dev":
      require =&gt; [ File["/home/vagrant/.ssh/key"]  ],
      ensure   =&gt; present,
      owner    =&gt; vagrant,
      provider =&gt; git,
      source   =&gt; "ssh://git@bitbucket.org/account/site.git",
      revision =&gt; 'master',
      identity =&gt; '/home/vagrant/.ssh/key',
  }
  </code></pre>
  
  <p>This part works fine but when I run the composer install as follows it dies when it hits the package referenced in the composer.json:</p>
  
  <pre><code>composer::exec { 'site-composer-run':
      cmd     =&gt; 'install',
      cwd     =&gt; '/var/www/site.dev',
      require =&gt; [
        Class['composer'],
        Vcsrepo["/var/www/site.dev"]
      ]
    }
  </code></pre>
  
  <p>I think what I need is a way of adding an ssh-key for a user without them being attached to a bash terminal, but I'm not too sure so I'm open to any and all suggestions at this point. Thanks in advance.</p>