Regex support in matcher-values of smart variables and parameters
The following would be nice functionality I think
Matching on something like: os =~ ^RedHat 6.* would greatly simplify doing stuff for different major versions of a specific distro.
lsbdistcodename is insufficient as all versions of CentOS report Final as codename.
operatingsystemmajrelease is insufficient as well, as that will also match Debian 6.x
Alternatively matching multiple facts using and/or logic would work as well.
osfamily = RedHat and (&&) operatingsystemmajrelease = 6
Updated by Finke Lamein almost 10 years ago
As extra sidenote:
as it stands now, there seems to be no way to differentiate between different CentOS major versions.
all the known facts, regarding OS versions
lsbdistdescription CentOS release 6.4 (Final) <--- Using regexes we could match this one as "^CentOS release 6\."
lsbdistcodename Final <--- this one being the major culprit, All CentOS releases are codenamed Final
Updated by Ordina Cloud Solutions over 9 years ago
We actually fixed this use case with a custom fact as follows:
family = Facter.value('osfamily')
major = Facter.value('operatingsystemmajrelease')
major = Facter.value('lsbmajdistrelease') if major.nil?
family + " " + major
Probably there are still some use cases in which regex support is more neat.