How to atomically update Puppet configuration?
I have a
puppetmaster (3.4.3) in a development environment fetching its configuration from a clone of a Git repository. Every ten minutes, the clone is updated by (essentially)
From time to time, in the process of Git doing its thing, the directory does not contain a valid Puppet configuration because files are replaced, swapped around, etc. If a Puppet client connects to the master during that time frame, the results are undefined, for example manifests or files cannot be found. (In theory, the worst thing would probably the
puppetmaster not seeing and thus not evaluating a Hiera file and using class defaults instead.) If there are no updates from Git,
puppetmaster will find a valid Puppet configuration again, so the problems are transient.
So I want to "lock"
puppetmaster from compiling a catalog when a Git update is in progress so that updates are atomic. I have read "Git Workflow and Puppet Environments", but for existing branches that does (essentially)
git pull as well. I do not want to create a new environment for each new commit, because that's probably more work than the ache the transient problems cause, and I'd like to avoid shutting down the
puppetmaster before a Git update and starting it again afterwards because that feels like overkill as well.
Is there an easy way to atomically update a Puppet configuration?