Skip to main content
Back to Blog
openvox

One Role Per Node, and the include vs. contain Surprise

Jerald Sheets

Catalog Cadence, issue 4. First published on LinkedIn, 2 December 2026: read it there and subscribe.

If you have been around Puppet or OpenVox for more than a minute, you have been told to use roles and profiles. It is still the right advice. It is also the pattern I see most often implemented in name only.

The idea is simple, and it stays simple if you are strict about it:

  • A role describes what a node is. role::webserver. role::db. One role per node. A role is allowed to include profiles, and not much else.
  • A profile describes a stack of technology the business actually uses: the web stack, the hardening baseline, the monitoring agent. Profiles contain the component modules and the logic that wraps them.
  • Component modules — yours or a Forge module — manage a technical thing: apache, postgresql, ntp. They should not know about your company.
Classification — Hiera, an ENC, a fact, a console group if you are on PE — assigns the one role. site.pp should not be quietly running the show with a pile of regex node statements that only two people remember. If you are coming off Puppet Enterprise, this is the work that decides whether a later OpenVox move is a package swap or a rewrite: the console classifier does not come with you.

When this is healthy, you can look at a node, name its role, and predict the catalog. When it is not, you have a profile::base that includes the world, three competing "web" profiles, and a site.pp that still special-cases the one host named after a retired engineer.

The relationship you wrote is not always the relationship the catalog has

I used to write a relationship against a profile and assume every class it pulled in would honor it.

They don't — not if those classes were brought in with include.

A class always contains its own resources. A relationship against Class['ntp'] does wait for everything ntp itself declares. The gotcha is the outer class. include declares a class, and it is safe to call more than once. It does not contain that class in the class that declared it. If profile::base uses include ntp, ntp's resources float outside profile::base. A relationship formed against that outer class will not wait for them.

This is the shape I keep finding in control repos, and I used to write it myself:


class profile::base {
include ntp
}

class role::web {
include profile::base
include profile::app
Class['profile::base'] -> Class['profile::app']
}

The catalog still compiles. That relationship looks right. ntp's resources are not actually ordered before profile::app. If profile::app starts a daemon that assumes the clock is already being disciplined, you get a Heisenbug: it works on a second run, or on a long-lived node, and fails on a freshly built one at 2 a.m.

contain declares the class and anchors it in the surrounding class, so a relationship formed against that outer class covers the contained resources too:


class profile::base {
contain ntp
}

Same role, same arrow, and now it waits for ntp. That is usually what I meant in a profile.

A few habits that stick:

  • In profiles, contain the component classes a role might order against through the profile.
  • include is still right when you only need the class declared, and no relationship against the profile should have to wait for it.
  • Roles can keep using include for profiles, as long as the profiles have contained what they need to contain.
  • When something starts "too early," I check for an include in the profile that should have been a contain before I rewrite the module.
It isn't a style preference. It's the difference between an order you wrote and an order the catalog actually has.

Hiera belongs in this picture

Roles and profiles without a Hiera 5 hierarchy you can explain in one breath will slowly turn into parameter lists that only the original author can extend. Data should be data: node, role, environment, and site facts in a lookup order you can draw on a whiteboard. Lookups should be explainable. Secrets should not be in plain YAML.

A profile that hard-codes the ntp servers for "our" network is a profile that will be copied, then copied again, the first time a second network shows up. A profile that looks up those servers and contains ntp is a profile you can reuse.

We'll stay out of a full Hiera sermon this week. The test is the same one I use for classification: can you explain it in one breath? If not, that's the finding.

Why this is a Healthcheck finding, not a Friday rewrite

I can spend a pleasant afternoon cleaning include versus contain in a single profile. I cannot, from a blog post, tell you whether your site.pp is still the real classifier, whether your roles are actually one-per-node, or whether the arrow that is failing in production is a containment bug or a module that just isn't idempotent.

That is why the starting point is a look, not a rewrite. In a Puppet & OpenVox Healthcheck we read the control repo and the in-house modules, we do not change them, and we hand you a written report: what's healthy, what's risky, and what we'd redesign first, with example code. Roles and profiles, Hiera 5, and classification are on the short list of things we always open.

The Healthcheck is a fixed price of $1,495. Onsite is available — ask us and we'll work out the details. After the report, some teams fix the pattern themselves. Some bring us back for on-prem design work or a migration sprint, once the catalog is something you'd be willing to move. Some decide the estate should not live in one person's muscle memory and talk to us about Configuration Management as a Service. All of that is later. The first deliverable is the map.

If you want that look, book a 15-minute intro call or start at ssconsultinggroup.net. We reply within 24 hours.

Next week: how a change should get from a commit to a catalog — r10k, pinned Puppetfiles, and letting the robots do the nagging. December still has ordinary work weeks left, if you use them.

— Jerald Sheets, S & S Consulting Group

---