-2

I want to do something along the lines of:

enter image description here

Is this possible with Puppet? If not, what's the best way I can distinguish modules by operating system?

AndreasKralj
  • 331
  • 1
  • 6
  • 16
  • To whoever downvoted, please explain why. If this is not possible with a node definition, is there another way to do this? – AndreasKralj Mar 06 '19 at 19:39
  • Probably down voted because there are details you haven't posted, or the DV doesn't understand the question. Short answer: Yes, it is possible. Are you using Puppet Enterprise? Puppet Open source (free version)? Foreman? – Scottie H Mar 11 '19 at 23:42

1 Answers1

2

I think, the answer you are looking for is $::osfamily
Will a case command work for your instance?

case $::osfamily {
  'Debian', 'Suse': {
       ...stuff for Deb/Suse...
   }
   'RedHat': {
        ...stuff for RH ...
    }
    'Windows': {
        ...stuff for Windows...
    }
    Default: {
        ... default stuff ...
    }
} # -- End Case


To see what else is available, at a command prompt run:
facter os

You can run facter with no arguments, send it to a file and peruse all the facts that puppet knows.

Dunatotatos
  • 103
  • 5
Scottie H
  • 227
  • 2
  • 10