Bug #8551
closedMultiple overrides in inherited Host Groups causing multiple values on host.
Description
After upgrading to 1.7.0 I have some hosts inside nested Host Groups who are either getting incorrect override values, or are getting multiple values for overrides.
Example:
Host Group:
/Base/Webfarm has override for class parameter _attributes in class opsview::monitored
/Base/Webfarm/Backup has override for the same parameter with a different value.
Hosts in /Base/Webfarm/Backup will get the override parameter from /Base/Webfarm.
If the setting "Merge overrides" is checked, then the hosts will get both override values from Base/Webfarm and base/Webfarm/Backup
The duplicate behavior occurs regardless of the "Avoid duplicates" setting as well.
Here is a Pastebin of the YAML for a host with both values for the parameter VCENTER: http://pastebin.com/c3uhFVm4
The value is overridden to 'vcenter' in Base/Webfarm and overridden to 'test-vcenter' in Base/Webfarm/Backup
Please let me know if I can provide any further information to help with the issue.
Updated by Ori Rabin almost 10 years ago
- Category set to Parameters
- Status changed from New to Need more information
I would appreciate if you can provide some more information for the two problems you mentioned:
1) Hosts in /Base/Webfarm/Backup will get the override parameter from /Base/Webfarm
can you please provide the order of overrides and the matchers with their values?
2) The duplication - it looks from the yaml that you have a parameter "_attributes" that is an array and the elements in it are hashes?
I'm trying to understand how exactly the values look like.
Avoid duplicates is used so if you have [name: a] twice you will only see one of them.
If your elements are [name: a] and [name: b] then it isn't a duplicate value.
Can you please send the values of the overrides for VCENTER as they appear in the "value" box in "_attributes"?
Updated by Dominic Cleal almost 10 years ago
- Translation missing: en.field_release set to 29
Just adding to the 1.7.1 tracker as this sounds like a regression.
Updated by Dominic Cleal almost 10 years ago
- Status changed from Need more information to New
I could reproduce this quite easily with a similar setup to the one that Matthew describes:
- Three host groups: Base, Base/Webfarm, Base/Webfarm/Backup
- Base environment set, others inherit
- 'monitor' Puppet class with one $_attributes parameter, defaults to []
- monitor Puppet class assigned to Base host group
- $_attributes parameter set to 'array' type
- hostgroup=Base/Webfarm matcher with value
[{"name":"VCENTER","value":"vcenter"}]
- hostgroup=Base/Webfarm/Backup matcher with value
[{"name":"VCENTER","value":"test-vcenter"}]
- one host with host group set to Base/Webfarm/Backup
Everything else is "default", i.e. no changes to parameter defaults, no merging or anything enabled. Then if I preview the YAML, I see:
--- classes: monitor: _attributes: - name: VCENTER value: vcenter parameters: puppetmaster: foreman.example.com hostgroup: Base/Webfarm/Backup
Updated by Dominic Cleal almost 10 years ago
Arrays and hashes seem irrelevant too, I can reproduce it with a string data type and the same matchers.
Updated by Dominic Cleal almost 10 years ago
It seems to just match anything. If I add fqdn=foobar (not its name) with another value, my host gets that new value.
Updated by The Foreman Bot almost 10 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/1996 added
- Pull request deleted (
)
Updated by Dominic Cleal almost 10 years ago
Dominic Cleal wrote:
It seems to just match anything. If I add fqdn=foobar (not its name) with another value, my host gets that new value.
This is incorrect, I can't replicate it and it doesn't make sense from the code. The issue is just when two overrides exist for two host groups within the same hierarchy - it's not preferring the more specific host group match.
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 daf34ae7195fda204ff6c9afdec8f14e4ce4f795.