Merge "Add child roles before parent" into feature/zuulv3
This commit is contained in:
commit
e4dc8771e5
|
@ -710,7 +710,9 @@ unless otherwise specified:
|
|||
Ansible Galaxy, or a Zuul role, which is a role provided by a
|
||||
project managed by Zuul. Zuul roles are able to benefit from
|
||||
speculative merging and cross-project dependencies when used by
|
||||
playbooks in untrusted projects.
|
||||
playbooks in untrusted projects. Roles are added to the Ansible
|
||||
role path in the order they appear on the job -- roles earlier in
|
||||
the list will take precedence over those which follow.
|
||||
|
||||
In the case of job inheritance or variance, the roles used for each
|
||||
of the playbooks run by the job will be only those which were
|
||||
|
@ -721,7 +723,9 @@ unless otherwise specified:
|
|||
pre and post playbooks, then any roles added by the child will be
|
||||
available to the child's playbooks. This is so that a job which
|
||||
inherits from a parent does not inadvertantly alter the behavior of
|
||||
the parent's playbooks by the addition of conflicting roles.
|
||||
the parent's playbooks by the addition of conflicting roles. Roles
|
||||
added by a child will appear before those it inherits from its
|
||||
parent.
|
||||
|
||||
A project which supplies a role may be structured in one of two
|
||||
configurations: a bare role (in which the role exists at the root of
|
||||
|
|
|
@ -864,9 +864,9 @@ class Job(object):
|
|||
|
||||
def addRoles(self, roles):
|
||||
newroles = list(self.roles)
|
||||
for role in roles:
|
||||
for role in reversed(roles):
|
||||
if role not in newroles:
|
||||
newroles.append(role)
|
||||
newroles.insert(0, role)
|
||||
self.roles = tuple(newroles)
|
||||
|
||||
def updateVariables(self, other_vars):
|
||||
|
|
Loading…
Reference in New Issue