Feature #3309
closedSupport deep merging of hash structures in smart class parameters
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)]
Updated by Dominic Cleal over 10 years ago
- Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1010575
Updated by Ohad Levy about 10 years ago
- Related to Feature #3636: Regex support in matcher-values of smart variables and parameters added
Updated by Stephen Benjamin about 10 years ago
- Related to Tracker #4470: Usability of parameters and overrides added
Updated by Ori Rabin about 10 years ago
- Status changed from New to Assigned
- Assignee set to Ori Rabin
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 (
)
Updated by Anonymous about 10 years ago
- Target version changed from 1.7.4 to 1.7.3
Updated by Dominic Cleal about 10 years ago
- Target version changed from 1.7.3 to 1.7.2
Updated by Marek Hulán almost 10 years ago
- Translation missing: en.field_release set to 21
Updated by Ori Rabin almost 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset ea4eec44b30b977bfd863d47b4fe3dd248816673.
Updated by Dominic Cleal almost 10 years ago
- Related to Bug #8217: Matchers/overrides have no clear grouping, mess of input boxes added
Updated by Dominic Cleal over 9 years ago
- Related to Feature #9949: deep merge broken when using facts in hash added
Updated by Dominic Cleal over 9 years ago
- Related to Bug #9672: Smart parameter: merge behavior for yaml parameters added
Updated by Dominic Cleal over 9 years ago
- Related to Feature #10731: Allow matches to merge with default values. added