How would you use facter and puppet to determine if the OS is running Cent 6.x or Cent 5.x ?
facter operatingsystemrelease
6.4
I only care about the major release (6)
I've thought about using awk, but there must be a better way that is more 'puppet manifest' friendly.
#This works, but is ugly trying to use this in a puppet manifest
facter operatingsystemrelease |awk -F. '{print $1}'
6
Update:
It looks like the newer versions of facter have some additional information about major releases that isn't in my version. My initial provisioning needs to assume that facter is out of date.
facter --version
1.6.4
puppet --version
2.7.20
I've tried searching for any additional facts that might show the major release, with the following command
facter |grep 6