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
697582fd
Commit
697582fd
authored
Nov 13, 2014
by
Jon Hadfield
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue whereby file will be transferred before checking the creates argument.
parent
ffc2e5a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
lib/ansible/runner/action_plugins/unarchive.py
+19
-0
No files found.
lib/ansible/runner/action_plugins/unarchive.py
View file @
697582fd
...
@@ -49,11 +49,30 @@ class ActionModule(object):
...
@@ -49,11 +49,30 @@ class ActionModule(object):
source
=
options
.
get
(
'src'
,
None
)
source
=
options
.
get
(
'src'
,
None
)
dest
=
options
.
get
(
'dest'
,
None
)
dest
=
options
.
get
(
'dest'
,
None
)
copy
=
utils
.
boolean
(
options
.
get
(
'copy'
,
'yes'
))
copy
=
utils
.
boolean
(
options
.
get
(
'copy'
,
'yes'
))
creates
=
options
.
get
(
'creates'
,
None
)
if
source
is
None
or
dest
is
None
:
if
source
is
None
or
dest
is
None
:
result
=
dict
(
failed
=
True
,
msg
=
"src (or content) and dest are required"
)
result
=
dict
(
failed
=
True
,
msg
=
"src (or content) and dest are required"
)
return
ReturnData
(
conn
=
conn
,
result
=
result
)
return
ReturnData
(
conn
=
conn
,
result
=
result
)
if
creates
:
# do not run the command if the line contains creates=filename
# and the filename already exists. This allows idempotence
# of command executions.
module_args_tmp
=
"path=
%
s"
%
creates
module_return
=
self
.
runner
.
_execute_module
(
conn
,
tmp
,
'stat'
,
module_args_tmp
,
inject
=
inject
,
complex_args
=
complex_args
,
persist_files
=
True
)
stat
=
module_return
.
result
.
get
(
'stat'
,
None
)
if
stat
and
stat
.
get
(
'exists'
,
False
):
return
ReturnData
(
conn
=
conn
,
comm_ok
=
True
,
result
=
dict
(
skipped
=
True
,
msg
=
(
"skipped, since
%
s exists"
%
creates
)
)
)
dest
=
self
.
runner
.
_remote_expand_user
(
conn
,
dest
,
tmp
)
# CCTODO: Fix path for Windows hosts.
dest
=
self
.
runner
.
_remote_expand_user
(
conn
,
dest
,
tmp
)
# CCTODO: Fix path for Windows hosts.
source
=
template
.
template
(
self
.
runner
.
basedir
,
os
.
path
.
expanduser
(
source
),
inject
)
source
=
template
.
template
(
self
.
runner
.
basedir
,
os
.
path
.
expanduser
(
source
),
inject
)
if
copy
:
if
copy
:
...
...
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