Feature #3636
openRegex support in matcher-values of smart variables and parameters
Description
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 Dominic Cleal about 11 years ago
- Related to Feature #3848: Matcher value for smart variables against array added
Updated by Finke Lamein almost 11 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
lsbmajdistrelease 6
operatingsystemmajrelease 6
operatingsystemrelease 6.4
lsbdistrelease 6.4
operatingsystem CentOS
lsbdistid CentOS
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
osfamily RedHat
Updated by Ordina Cloud Solutions over 10 years ago
We actually fixed this use case with a custom fact as follows:
Facter.add("familygeneration") do
setcode do
family = Facter.value('osfamily')
major = Facter.value('operatingsystemmajrelease')
major = Facter.value('lsbmajdistrelease') if major.nil?
family + " " + major
end
end
Probably there are still some use cases in which regex support is more neat.
Greetings Finke
Updated by Ohad Levy over 10 years ago
- Related to Feature #3309: Support deep merging of hash structures in smart class parameters added
Updated by Ori Rabin over 10 years ago
- Status changed from New to Assigned
- Assignee set to Ori Rabin
Updated by Stephen Benjamin over 10 years ago
- Subject changed from Regex support in matcher-values of smart variables to Regex support in matcher-values of smart variables and parameters
Would be useful for smart class parameters as well.
Updated by Anonymous over 10 years ago
- Target version changed from 1.7.4 to 1.7.3
Updated by Ori Rabin about 10 years ago
- Related to Tracker #4470: Usability of parameters and overrides added
Updated by Ori Rabin over 9 years ago
- Status changed from Assigned to New
- Assignee deleted (
Ori Rabin)