I started working with Puppet 3, now version 8 is out and about . Well, Open Source Puppet that is.
Over the time the way you use facts have significantly changed. In version 6 and 7, you could use facts like $::operatingsystem and $::operatingsystemmajrelease in your Puppetcode and parameters to determine what you are running on.
Why is this important: Well you might be indeed on different OS distributions or even only on different versions of it. And it might be a difference for your code for various reasons.
For instance, I am running my own cloud and started with CentOS 6. But this is no longer of use for me, so I had to switch to Rocky (another Redhat-based distribution) and this is on version 9 now. Plenty of changes, I can tell you that.
Since Puppet 8, the way with top level facts has definitely changed. To find out the details of your operating system via parameter definition, you have to go like this now:
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
and so on Then you can easily use the parameters you defined via params.pp in your code. In my case, the parameters above return Rocky 9.
Happy coding!
Author Profile
Latest entries
blog07.01.2026Puppet with Foreman – R10k
blog07.01.2026Puppet with Foreman – Installation
blog04.01.2026Puppet with Foreman – Pilot
blog26.12.2025Publishing Pipeline v1.2.0 – backlinks and X support

