Welcome back I just realized that it has been almost 4 months since my last post. If you missed it, you should probably read it before this one. I kicked off quite a bit of work then and much has come to fruition in the meantime. This is my report.
Update: This post is quite extensive and covers the guts of the implementation. For a succinct overview of the new functionality, see the follow-up.
[Read More]
From Catalog To Mgmt
Have you heard of mgmt yet? It’s (currently) a prototype config management engine written by James and brings some exciting new ideas to the table, building on the proven concepts of Puppet. You should probably read up on it right now.
James gave the inaugural demo at ConfigMgmtCamp 2016 in Gent, Belgium, and mentioned that he can picture a sort of “transpiler” that will create resource graphs from Puppet manifest code.
[Read More]
Using Http Files
Overview In the introductory post about the new support for source => "http://..." parameters in Puppet’s file resource type, I promised a follow-up that would explain the technical details of the implementation. This is not that post.
Instead, seeing as Puppet 4.4 will hopefully be released soon and make this feature available to you, I will explain the caveats in greater detail first and add some perspective on how to best circumvent them.
[Read More]
Building Http Support
Overview One of the most requested capabilities for Puppet has been to support code such as the following:
file { '/opt/jdk.tar.gz': source => 'http://filerepo.local/java/jdk.tar.gz', } Retrieving files (especially larger archives) via HTTP is a very convenient practice. People have been doing it through custom exec resources and defined types all over the place, for years. There are several sophisticated modules that bring this capability along.
Still, all these approaches lack some of the convenience that Puppet’s file type brings to the table.
[Read More]
Friends Don't Let Friends Use Refreshonly
Update 2017-09-03: A code example included an invalid resource reference. Many thanks to Jo Rhett for pointing it out.
Manifest imperfection The goal of any Puppet manifest is to describe a desired state. Puppet’s abstraction model breaks this down into an arbitrary set of discrete resources. Each resource describes a specific piece of system state.
file { '/etc/shadow': owner => 'root', mode => '0600', } This approach is oft proven to yield very maintainable and readable code.
[Read More]
Master Load Balancing
Background At his amazing presentation of the new features in Puppet 4 at Puppet Camp Berlin 2015, Martin explained how masters can be configured to perform only a subset of the available master services. This way you can have, say, a single CA server, some file servers and a swarm of manifest compilers.
Someone in the audience asked how to use this, since typically you address the master through just the one domain name (e.
[Read More]
Debugging Rspec Of Catalog Application
Running catalogs from RSpec tests is tricky. There are some examples in the existing test base that help doing it. One basic pattern goes like this:
describe SomeThing let(:catalog) { Puppet::Resource::Catalog.new } context "when doing something else" do let(:resource) do Puppet::Type::MyType.new( :ensure => :present, :param => 'value', ) end it "behaves a certain way" do catalog.add_resource(resource) catalog.apply expect( check_result() ).to be_truthy end end end Of course, such tests can fail for various reasons.
[Read More]
Turning Puppet's HTTP Support Up A Notch
Making HTTP requests from within Puppet Puppet without HTTP support is unthinkable. Most if not all communications between the different parts of a Puppet setup use REST APIs. Puppet modules from the Forge are retrieved through HTTPS exclusively.
There are convenient methods available in the existing code base, which can be used by new features that need to perform HTTP requests. There are some details and limitations to keep in mind, though.
[Read More]
The Belgium Conferences 2015 Edition
Getting to the conference It was that magic time of the year again - Belgium lured professionals and enthusiasts to great conferences. FOSDEM is one of the world’s largest gathering of open source software contributors and vendors. For me, the place to be afterwards is Config Management Camp, a gathering of users and developers of configuration management software such as Puppet, Ansible or Chef. (Fun fact: attendees expressed broader interest in Ansible than Chef this year, apparently.
[Read More]
Who Moved My Cheese
Finding out why Travis fails your latest PR - 2 minutes. Reproducing locally and figuring out how to fix the issue - 3 hours. Squashing and rebasing to master, then finding out that the issue reappeared due to the rebase - priceless.
What is it now? The work on PUP-3341 had basically been finished weeks earlier. The mailing list had consented (or something like that) and implementation had gone rather swimmingly.
[Read More]