Description of problem: 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 Additional info: http://www.theforeman.org/manuals/1.2/index.html#4.2.5ParameterizedClasses http://www.youtube.com/watch?v=Ksr0tilbmcc
We should probably do the same for arrays too, e.g. admin_users = [] hostgroup = [user1, user2] location = [user3, user4] admin users = [user(1..4)] (thanks Ohad)
Moving to POST since upstream bug http://projects.theforeman.org/issues/3309 has been closed ------------- Ori Rabin Applied in changeset commit:ea4eec44b30b977bfd863d47b4fe3dd248816673.
please provide verification steps thanks
Tazim, besides the deep dive I sent you these are some of the things that need varification: - The steps to reproduce from the beginning using the type 'hash' for the variable/parameter - The merge override button is only enabled for array/hash parameter type - The avoid duplicates is only available for arrays - Using "avoid duplicates": use the steps from the beginning with the values ['a'] for both matchers
VERIFIED : # rpm -qa | grep foreman foreman-postgresql-1.7.2.15-1.el6_6sat.noarch foreman-ovirt-1.7.2.15-1.el6_6sat.noarch ruby193-rubygem-foreman-tasks-0.6.12.3-1.el6_6sat.noarch rubygem-hammer_cli_foreman_bootdisk-0.1.2.5-1.el6_6sat.noarch ruby193-rubygem-foreman-redhat_access-0.1.0-1.el6_6sat.noarch rubygem-hammer_cli_foreman-0.1.4.7-1.el6_6sat.noarch rubygem-hammer_cli_foreman_tasks-0.0.3.3-1.el6_6sat.noarch foreman-1.7.2.15-1.el6_6sat.noarch foreman-gce-1.7.2.15-1.el6_6sat.noarch ruby193-rubygem-foreman_bootdisk-4.0.2.10-1.el6_6sat.noarch ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el6_6sat.noarch foreman-debug-1.7.2.15-1.el6_6sat.noarch rubygem-hammer_cli_foreman_discovery-0.0.1.4-1.el6_6sat.noarch foreman-selinux-1.7.2.13-1.el6_6sat.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-proxy-1.0-2.noarch foreman-compute-1.7.2.15-1.el6_6sat.noarch ruby193-rubygem-foreman_docker-1.2.0.7-1.el6_6sat.noarch ruby193-rubygem-foreman_discovery-2.0.0.9-1.el6_6sat.noarch foreman-libvirt-1.7.2.15-1.el6_6sat.noarch foreman-proxy-1.7.2.4-1.el6_6sat.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-client-1.0-1.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch ruby193-rubygem-foreman_hooks-0.3.7-2.el6_6sat.noarch foreman-vmware-1.7.2.15-1.el6_6sat.noarch able to select parameters with Override enable the merge override button is only enabled for array/hash parameter type the avoid duplicates is only available for arrays
*** Bug 1175885 has been marked as a duplicate of this bug. ***
This bug is slated to be released with Satellite 6.1.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2015:1592