mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 12:59:09 -07:00
allow users to control group var merge order (#22580)
* allow users to control group var merge order With ansible_group_priority var at each group will determine merge order with siblings, falling back to sorted names when priority is equal as it did before. Parent/children relationships still work as they did and have higher precedence than priority * move priority setting to groups, sourc indep * now both inventory and play group follow priority * removed double exception handling
This commit is contained in:
parent
5334814396
commit
4319ddd5de
5 changed files with 9 additions and 11 deletions
|
@ -160,10 +160,7 @@ class InventoryParser(object):
|
|||
# applied to the current group.
|
||||
elif state == 'vars':
|
||||
(k, v) = self._parse_variable_definition(line)
|
||||
if k != 'ansible_group_priority':
|
||||
self.groups[groupname].set_variable(k, v)
|
||||
else:
|
||||
self.groups[groupname].set_priority(v)
|
||||
self.groups[groupname].set_variable(k, v)
|
||||
|
||||
# [groupname:children] contains subgroup names that must be
|
||||
# added as children of the current group. The subgroup names
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue