Project

General

Profile

Actions

Feature #3309

closed

Support deep merging of hash structures in smart class parameters

Added by Dominic Cleal almost 11 years ago. Updated over 6 years ago.

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

Description

When storing complex hashes in smart variables/class parameters (i.e. JSON/YAML), the matchers simply override previous values with a certain precedence order.

Instead, we want to be able to deep merge data across the matchers, so a hash can be built up with a culmination of data.

Steps to Reproduce:
1. set a parameter/variable matcher order to "fqdn", "hostgroup", set data type to JSON
2. add an override of "hostgroup=Example" (change as appropriate), value: {"example":{"foo":"bar"}}
3. add an override of "fqdn=foo.example.com" (change), value: {"example":{"bar":"baz"}}
4. check YAML output on foo.example.com's host page

Actual results:
example:
bar: baz

Expected results:
example:
foo: bar
bar: baz

We should probably do the same for arrays too, e.g.

admin_users = []

hostgroup = [user1, user2]
location = [user3, user4]

admin users = [user(1..4)]


Related issues 6 (4 open2 closed)

Related to Foreman - Feature #3636: Regex support in matcher-values of smart variables and parametersNew11/12/2013Actions
Related to Foreman - Tracker #4470: Usability of parameters and overridesNew

Actions
Related to Foreman - Bug #8217: Matchers/overrides have no clear grouping, mess of input boxesClosedOri Rabin10/30/2014Actions
Related to Foreman - Feature #9949: deep merge broken when using facts in hashNewActions
Related to Foreman - Bug #9672: Smart parameter: merge behavior for yaml parametersNew03/06/2015Actions
Related to Foreman - Feature #10731: Allow matches to merge with default values.ClosedOri Rabin06/08/2015Actions
Actions #1

Updated by Dominic Cleal over 10 years ago

  • Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1010575
Actions #2

Updated by Ohad Levy about 10 years ago

  • Related to Feature #3636: Regex support in matcher-values of smart variables and parameters added
Actions #3

Updated by Stephen Benjamin about 10 years ago

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

Updated by Ori Rabin about 10 years ago

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

Updated by Ori Rabin about 10 years ago

  • Target version set to 1.7.4
Actions #6

Updated by The Foreman Bot about 10 years ago

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

Updated by Anonymous about 10 years ago

  • Target version changed from 1.7.4 to 1.7.3
Actions #8

Updated by Dominic Cleal about 10 years ago

  • Target version changed from 1.7.3 to 1.7.2
Actions #9

Updated by Marek Hulán almost 10 years ago

  • Translation missing: en.field_release set to 21
Actions #10

Updated by Ori Rabin almost 10 years ago

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

Updated by Dominic Cleal almost 10 years ago

  • Related to Bug #8217: Matchers/overrides have no clear grouping, mess of input boxes added
Actions #12

Updated by Dominic Cleal over 9 years ago

  • Related to Feature #9949: deep merge broken when using facts in hash added
Actions #13

Updated by Dominic Cleal over 9 years ago

  • Related to Bug #9672: Smart parameter: merge behavior for yaml parameters added
Actions #14

Updated by Dominic Cleal over 9 years ago

  • Related to Feature #10731: Allow matches to merge with default values. added
Actions

Also available in: Atom PDF