Rapid feedback

A good workflow should provide constant feedback to its users. Each step should be clearly defined, with strict pass or fail criteria. For example, Git will warn a user whenever it detects a problem, such as being unable to pull code or push code back to the origin repository. We can extend this with Git commit hooks, both server-side and client-side, which perform checks to ensure that the code is in a proper state before being accepted into an organizational Git server from the local repository. Running Puppet itself within our test criteria, we expect clean and idempotent runs. The Puppet catalog should not produce failing resources, nor should it manage the same resource with every Puppet run.

The time it takes to solve problems with Puppet shrinks as more feedback is provided by a workflow to the engineer. If you work in a workflow that requires pushing code to an environment on the Puppet Master, and you are testing on a true agent, a simple run of puppet parser validate can save a lot of time. The parser validation will quickly tell you if Puppet code can be compiled, rather than what it will do. This simple command can reduce the number of times that we git commit on the code, push it to the Git repository, deploy it to an environment, log in to the test machine, and wait for the Puppet agent to trigger a catalog error. We can even ensure that this command is run before every commit with a precommit Git hook. Automated testing tools, such as RSpec and Beaker, can extend this methodology, and, combined with a CI/CD pipeline (discussed in the next chapter), can provide even more rapid feedback to code developers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.76.164