title: Generating self signed certificate for testing nginx via vagrant vm
body: <p>I generated a Vagrant VM for testing using the excellent <a href="https://puphpet.com/" rel="nofollow">PuPHPet</a> tool. I've done some puppet hacking previously, but I'm stuck on generating a self-signed SSL certificate for use with the VM. I'm familiar with doing it purely via openssl commands, but I'm looking for a puppet solution. </p>
  
  <p>I've browsed a bit of the puppet ssl source, but I'm not sure this is the right avenue to explore: <a href="https://github.com/puppetlabs/puppet/tree/master/lib/puppet/ssl" rel="nofollow">https://github.com/puppetlabs/puppet/tree/master/lib/puppet/ssl</a></p>
  
  <p>I also stumbled on this shell script that the author used with puppet:
  <a href="http://www.codenes.com/blog/?p=300" rel="nofollow">http://www.codenes.com/blog/?p=300</a></p>
  
  <p>Useful, but not exactly a puppet configuration.</p>
  
  <p>The lazy way would be to fire up the VM and generate the certificate manually. Then, use a <code>file</code> resource declaration to copy the previously generated certificate when launching the VM. Not ideal, I'd prefer more automation.</p>