|
|
|
@ -193,7 +193,6 @@ def main():
|
|
|
|
|
src = os.path.expanduser(module.params['src'])
|
|
|
|
|
dest = os.path.expanduser(module.params['dest'])
|
|
|
|
|
copy = module.params['copy']
|
|
|
|
|
creates = module.params['creates']
|
|
|
|
|
|
|
|
|
|
# did tar file arrive?
|
|
|
|
|
if not os.path.exists(src):
|
|
|
|
@ -204,20 +203,6 @@ def main():
|
|
|
|
|
if not os.access(src, os.R_OK):
|
|
|
|
|
module.fail_json(msg="Source '%s' not readable" % src)
|
|
|
|
|
|
|
|
|
|
if creates:
|
|
|
|
|
# do not run the command if the line contains creates=filename
|
|
|
|
|
# and the filename already exists. This allows idempotence
|
|
|
|
|
# of command executions.
|
|
|
|
|
v = os.path.expanduser(creates)
|
|
|
|
|
if os.path.exists(v):
|
|
|
|
|
module.exit_json(
|
|
|
|
|
stdout="skipped, since %s exists" % v,
|
|
|
|
|
skipped=True,
|
|
|
|
|
changed=False,
|
|
|
|
|
stderr=False,
|
|
|
|
|
rc=0
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# is dest OK to receive tar file?
|
|
|
|
|
if not os.path.isdir(dest):
|
|
|
|
|
module.fail_json(msg="Destination '%s' is not a directory" % dest)
|
|
|
|
|