title: Developing Puppet locally using Vagrant + Docker
body: <p>I'm trying to come up with a strategy for developing puppet roles and profiles locally. Ideally I want a self-contained git repo that has everything needed to stand up the master as well as a test node(s) that roles under development can be applied to and validated. </p>
  
  <p>My current solution is to use docker-compose to <a href="https://github.com/puppetlabs/puppet-in-docker-examples/tree/master/compose" rel="nofollow noreferrer">launch a local puppet master</a>. This maps the local code folder on my dev machine to the /etc/puppet/code volume on the master container. For the test nodes part I'm thinking I can use vagrant with a puppet provisioner. The reason I selected vagrant (as opposed to just running docker agent images is that some of my roles apply to windows machines. This seems like the best option for supporting both windows and linux puppet roles.</p>
  
  <p>My struggle at the moment is figuring out how to bridge the two virtual networks (vagrant to docker). I can sort of fake it out by exporting the puppet master ports (8140) to the host and then pointing my vagrant provisioner at the host. The problem with this approach is that I have to use the gateway IP assigned to the vagrant guest (corresponds to the host) and I'm not confident that solution is going to be stable across my team.</p>
  
  <p>I'm looking for suggestions on...</p>
  
  <ul>
  <li>does this seem like a viable/correct approach for accomplishing my goal?  </li>
  <li>how can I cleanly combine these two solutions (docker + vagrant)  </li>
  <li>have I missed some existing standard practice that already solves this problem?  </li>
  </ul>
  
  <p>Here is <a href="https://github.com/markjgardner/LocalPuppetDevelopment" rel="nofollow noreferrer">the github repo</a> with my work so far. Feel free to submit a PR with any suggestions.</p>