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
blog18.04.2026ConfDroid Puppet Modules – java
blog18.04.2026ConfDroid Puppet Modules – SSH
blog11.04.2026ConfDroid Puppet Modules – Selinux
blog07.04.2026ConfDroid Puppet Modules – Automatic
