Logical thoughts exposed

A journey through my life as a infrastructure developer

Apr 2, 2019 - 4 minute read - Comments - debugger puppet pdk devops

Adding Puppet Debugger and other gems when using PDK

The Puppet Development Kit (PDK) makes it really simple and efficient to work on puppet modules. If you have never used the PDK I would encourage you to try it out especially if you use windows. The PDK wraps all the annoying tasks so that you don’t have to endure the pain of modifying Gemfiles, spec files, folder structure and other puppet related module development tasks. But with any good wrapper code, what you gain in efficiency you do so at the cost of control and customization.

Sep 25, 2018 - 4 minute read - Comments - debugger devops puppet testing mocking

Alternative Facts

What does Puppet and alternative facts have in common? No, this is not some political rant about how real facts matter. This article is about sub-planting alternative puppet facts provided by custom external FacterDB facts. But first. What the hell are FacterDB facts? FacterDB facts are artisanal hand-made facter sets from real systems stashed into a filesystem based “database” and searchable via facts. Basically just run puppet facts and save them off into git to get an idea.

Sep 25, 2018 - 6 minute read - Comments - debugger hiera puppet devops

Debugging and Inspecting hiera lookups

Summary: In this article you will learn how to debug hiera lookups using the traditional methods and more importantly with the puppet-debugger which can cover a multitude of use cases. Previously, debugging hiera lookups has been limited to the command line and debug logs. If you wanted to debug hiera lookups you had to use the hiera command and pass in the config file along with the scope (variables, facts) you wanted to use.

Oct 12, 2017 - 2 minute read - Comments - puppet devops bolt

Retrospec - the task generator

Puppet introduced Bolt at Puppetconf 2017 this year and so far I like what I see. Simple, easy to use remote task execution without a huge requirement of any one language. Best of all puppet modules can start adding one off bolt tasks to help with the administrative duties of various applications. Bolt makes it really easy to get started but adds some required scaffolding to create a properly defined task, namely the metadata file.

Jun 1, 2017 - 3 minute read - Comments - devops puppet retrospec generator hiera

Put some data in your module

Puppet 4.9 cemented the final touches to putting data in puppet modules with the release of hiera 5. Which by the way hiera is now part of Puppet project instead of a separate gem as with previous versions. So now that that whole params.pp mess is over we can finally move forward and create modules with rich sets of data without resorting to the params.pp hack. So lets get started.

Apr 25, 2017 - 4 minute read - Comments - devops puppet testing debugger breakpoint

Break into your puppet code

The puppet 4 language introduced a slew of new features that gives us enormous amounts of power and flexibility. So much so that puppet code can become complex and often hard to understand at a glance. A way to combat this complexity is to write unit tests to validate the end state. However, one of the shortcomings of unit testing with rspec-puppet is that you can only test against the end state.