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
85099be4
Commit
85099be4
authored
Apr 12, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2656 from dstoflet/first_available_file_fix
Quick fix for first_available_file and role support
parents
b8c5a58b
c63207bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
lib/ansible/runner/action_plugins/copy.py
+2
-1
lib/ansible/runner/action_plugins/template.py
+3
-3
No files found.
lib/ansible/runner/action_plugins/copy.py
View file @
85099be4
...
...
@@ -55,10 +55,11 @@ class ActionModule(object):
if
'first_available_file'
in
inject
:
found
=
False
for
fn
in
inject
.
get
(
'first_available_file'
):
fn_orig
=
fn
fn
=
template
.
template
(
self
.
runner
.
basedir
,
fn
,
inject
)
fn
=
utils
.
path_dwim
(
self
.
runner
.
basedir
,
fn
)
if
not
os
.
path
.
exists
(
fn
)
and
'_original_file'
in
inject
:
fn
=
utils
.
path_dwim_relative
(
inject
[
'_original_file'
],
'files'
,
fn
,
self
.
runner
.
basedir
,
check
=
False
)
fn
=
utils
.
path_dwim_relative
(
inject
[
'_original_file'
],
'files'
,
fn
_orig
,
self
.
runner
.
basedir
,
check
=
False
)
if
os
.
path
.
exists
(
fn
):
source
=
fn
found
=
True
...
...
lib/ansible/runner/action_plugins/template.py
View file @
85099be4
...
...
@@ -54,15 +54,15 @@ class ActionModule(object):
# look up the files and use the first one we find as src
if
'first_available_file'
in
inject
:
found
=
False
for
fn
in
self
.
runner
.
module_vars
.
get
(
'first_available_file'
):
fn_orig
=
fn
fnt
=
template
.
template
(
self
.
runner
.
basedir
,
fn
,
inject
)
fnd
=
utils
.
path_dwim
(
self
.
runner
.
basedir
,
fnt
)
if
not
os
.
path
.
exists
(
fnd
)
and
'_original_file'
in
inject
:
fnd
=
utils
.
path_dwim_relative
(
inject
[
'_original_file'
],
'templates'
,
fn
d
,
self
.
runner
.
basedir
,
check
=
False
)
fnd
=
utils
.
path_dwim_relative
(
inject
[
'_original_file'
],
'templates'
,
fn
_orig
,
self
.
runner
.
basedir
,
check
=
False
)
if
os
.
path
.
exists
(
fnd
):
source
=
fn
t
source
=
fn
d
found
=
True
break
if
not
found
:
...
...
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