mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
Updates for the unarchive module and action_plugin.
There is a bit going on with the changes here. Most of the changes are cleanup of files so that they line up with the standard files. PR #5136 was merged into the current devel and brought up to working order. A few bug fixes had to be done to get the code to test correctly. Thanks out to @pib! Issue #5431 was not able to be confirmed as it behaved as expected with a sudo user. Tests were added via a playbook with archive files to verify functionality. All tests fire clean including custom playbooks across multiple linux and solaris systems.
This commit is contained in:
parent
e6c9705058
commit
cb7c2b7524
7 changed files with 416 additions and 316 deletions
|
@ -28,11 +28,9 @@ from ansible.runner.return_data import ReturnData
|
|||
import sys
|
||||
reload(sys)
|
||||
sys.setdefaultencoding("utf8")
|
||||
#import base64
|
||||
#import stat
|
||||
#import tempfile
|
||||
import pipes
|
||||
|
||||
|
||||
class ActionModule(object):
|
||||
|
||||
TRANSFERS_FILES = True
|
||||
|
@ -53,7 +51,7 @@ class ActionModule(object):
|
|||
copy = utils.boolean(options.get('copy', 'yes'))
|
||||
|
||||
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)
|
||||
|
||||
source = template.template(self.runner.basedir, source, inject)
|
||||
|
@ -65,7 +63,7 @@ class ActionModule(object):
|
|||
|
||||
remote_md5 = self.runner._remote_md5(conn, tmp, dest)
|
||||
if remote_md5 != '3':
|
||||
result = dict(failed=True, msg="dest must be an existing dir")
|
||||
result = dict(failed=True, msg="dest must be an existing dir", rc=remote_md5)
|
||||
return ReturnData(conn=conn, result=result)
|
||||
|
||||
if copy:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue