Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
ffdba966
Commit
ffdba966
authored
Sep 29, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save the included directory for playbook includes for use as the basedir
Fixes #12524
parent
4226e49b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
lib/ansible/executor/playbook_executor.py
+3
-0
lib/ansible/playbook/play.py
+4
-0
lib/ansible/playbook/playbook_include.py
+2
-0
No files found.
lib/ansible/executor/playbook_executor.py
View file @
ffdba966
...
...
@@ -83,6 +83,9 @@ class PlaybookExecutor:
self
.
_display
.
vv
(
'
%
d plays in
%
s'
%
(
len
(
plays
),
playbook_path
))
for
play
in
plays
:
if
play
.
_included_path
is
not
None
:
self
.
_loader
.
set_basedir
(
play
.
_included_path
)
# clear any filters which may have been applied to the inventory
self
.
_inventory
.
remove_restriction
()
...
...
lib/ansible/playbook/play.py
View file @
ffdba966
...
...
@@ -95,6 +95,7 @@ class Play(Base, Taggable, Become):
def
__init__
(
self
):
super
(
Play
,
self
)
.
__init__
()
self
.
_included_path
=
None
self
.
ROLE_CACHE
=
{}
def
__repr__
(
self
):
...
...
@@ -321,12 +322,14 @@ class Play(Base, Taggable, Become):
for
role
in
self
.
get_roles
():
roles
.
append
(
role
.
serialize
())
data
[
'roles'
]
=
roles
data
[
'included_path'
]
=
self
.
_included_path
return
data
def
deserialize
(
self
,
data
):
super
(
Play
,
self
)
.
deserialize
(
data
)
self
.
_included_path
=
data
.
get
(
'included_path'
,
None
)
if
'roles'
in
data
:
role_data
=
data
.
get
(
'roles'
,
[])
roles
=
[]
...
...
@@ -341,5 +344,6 @@ class Play(Base, Taggable, Become):
def
copy
(
self
):
new_me
=
super
(
Play
,
self
)
.
copy
()
new_me
.
ROLE_CACHE
=
self
.
ROLE_CACHE
.
copy
()
new_me
.
_included_path
=
self
.
_included_path
return
new_me
lib/ansible/playbook/playbook_include.py
View file @
ffdba966
...
...
@@ -80,6 +80,8 @@ class PlaybookInclude(Base, Conditional, Taggable):
temp_vars
.
update
(
new_obj
.
vars
)
entry
.
vars
=
temp_vars
entry
.
tags
=
list
(
set
(
entry
.
tags
)
.
union
(
new_obj
.
tags
))
if
entry
.
_included_path
is
None
:
entry
.
_included_path
=
os
.
path
.
dirname
(
file_name
)
return
pb
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment