Building a system at work to create disposable machines for developer and QA use that will match production. The process looks like this:
- Query Foreman for Puppet classes used by a hostgroup
- Create a Puppetfile with some knowledge about where we keep modules and the names that Foreman provides
- Run r10k to sync the modules
I did a bunch of work to extract some metadata from the Modulefiles, but that was completely unnecessary and thus stupid. Never hurts to take a step back and draw a process before jumping down a rabbit hole.
I have enough information that I could skip creating the Puppetfile all together and just clone the repo myself, but I think I like the idea of using r10k to install modules from the Puppetfile for two reasons:
- It ensures that stale modules are purged gracefully. (I would have just scorched the Earth and deleted the entire modules directory)
- It produces an artifact that can be used by other standard tools if necessary.