Project

General

Profile

Actions

Feature #3636

open

Regex support in matcher-values of smart variables and parameters

Added by Finke Lamein about 11 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Parameters
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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


Related issues 3 (2 open1 closed)

Related to Foreman - Feature #3848: Matcher value for smart variables against arrayNew12/11/2013Actions
Related to Foreman - Feature #3309: Support deep merging of hash structures in smart class parametersClosedOri Rabin10/17/2013Actions
Related to Foreman - Tracker #4470: Usability of parameters and overridesNew

Actions
Actions #1

Updated by Dominic Cleal about 11 years ago

  • Category set to Parameters
Actions #2

Updated by Dominic Cleal almost 11 years ago

  • Related to Feature #3848: Matcher value for smart variables against array added
Actions #3

Updated by Finke Lamein over 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

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

Actions #4

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

Actions #5

Updated by Ohad Levy about 10 years ago

  • Related to Feature #3309: Support deep merging of hash structures in smart class parameters added
Actions #6

Updated by Ori Rabin about 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin
Actions #7

Updated by Dominic Cleal about 10 years ago

  • Target version set to 1.7.4
Actions #8

Updated by Stephen Benjamin about 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.

Actions #9

Updated by Stephen Benjamin about 10 years ago

  • Bugzilla link set to 1132453
Actions #10

Updated by Anonymous about 10 years ago

  • Target version changed from 1.7.4 to 1.7.3
Actions #11

Updated by Ohad Levy about 10 years ago

  • Target version deleted (1.7.3)
Actions #12

Updated by Ori Rabin about 10 years ago

  • Related to Tracker #4470: Usability of parameters and overrides added
Actions #13

Updated by Ori Rabin over 9 years ago

  • Status changed from Assigned to New
  • Assignee deleted (Ori Rabin)
Actions

Also available in: Atom PDF