Project

General

Profile

Bug #5554

Smart Class Parameter override matches throw error when matching on multiple matchers

Added by Ryan Sabatini over 7 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Parameters
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Matching on multiple values will fail when fqdn or hostgroup is listed first. For example: matching on hostgroup=Servers,osfamily=RedHat will throw the error "hostgroup=Servers,osfamilyRedHat does not match an existing hostgroup"; however, switching the order to osfamily=RedHat,hostgroup=Servers will successfully add the match to the Smart Class Parameter.

bugexample.PNG View bugexample.PNG 24.4 KB Ryan Sabatini, 05/02/2014 02:09 PM
Bugexample

Related issues

Related to Foreman - Bug #8333: Incorrect matcher values with multi-key matchersClosed2014-11-10

Associated revisions

Revision eb414b8b (diff)
Added by Ori Rabin over 6 years ago

Fixes #5554 - fixed hostgroup and fqdn validations in multiple matchers

Revision 4098e93b (diff)
Added by Dominic Cleal over 6 years ago

refs #5554 - revert string change, save unnecessary retranslation

Revision c1f06a4f (diff)
Added by Ori Rabin over 6 years ago

Fixes #5554 - fixed hostgroup and fqdn validations in multiple matchers

(cherry picked from commit eb414b8bbdc7897f396d184996fac402b3277cef)

Revision 7f6e33b7 (diff)
Added by Dominic Cleal over 6 years ago

refs #5554 - revert string change, save unnecessary retranslation

(cherry picked from commit 4098e93bc45176ffd8f659d28d0db1f8cb1d7734)

History

#1 Updated by Dominic Cleal over 7 years ago

I'm pretty certain using multiple matchers isn't possible either way - what's happening when you use hostgroup= first is that it's able to verify this against known host groups. When using osfamily= first, it's matching on a fact and so can't verify possible values.

#2 Updated by Ryan Sabatini over 7 years ago

The Foreman Manual for release 1.4 under the section "Example 2 - Change for a group of hosts (via custom fact) with validation and ordering" shows that matching on multiple values is possible. The manual states this is for smart variables, but it also works for smart class parameters.

We have multiple instances running in our environment where we are successfully matching on multiple values and applying the correct overrides. For example, we currently have sitecfg_purpose= ,hostgroup= as match criteria for a smart class parameter (sitecfg_purpose being a custom fact). The server meeting the credentials will successfully override the value. When we had the order of the two reversed to hostgroup= , sitecfg_purpose= Foreman would throw the error "hostgroup=(hostgroup),sitecfg_purpose=(purpose) does not match an existing hostgroup".

#3 Updated by Ori Rabin almost 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin

#4 Updated by The Foreman Bot almost 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1923 added
  • Pull request deleted ()

#5 Updated by Dominic Cleal over 6 years ago

  • Legacy Backlogs Release (now unused) set to 50

#6 Updated by Ori Rabin over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by Dominic Cleal over 6 years ago

  • Related to Bug #8333: Incorrect matcher values with multi-key matchers added

Also available in: Atom PDF