Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix copying for more than one host. Fix md5 checks #891

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/ansible/runner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ def _executor_internal(self, host):
def _executor_internal_inner(self, host, inject, port, is_chained=False):
''' decides how to invoke a module '''

# store module_name and module_args for next run
preserve_module_name = self.module_name
preserve_module_args = self.module_args

# special non-user/non-fact variables:
# 'groups' variable is a list of host name in each group
# 'hostvars' variable contains variables for each host name
Expand Down Expand Up @@ -595,6 +599,9 @@ def _executor_internal_inner(self, host, inject, port, is_chained=False):
self.module_args = result.result['daisychain_args']
result2 = self._executor_internal_inner(host, inject, port, is_chained=True)
result2.result['module'] = self.module_name
# restore module_name and module_args after daisychaining!
self.module_name = preserve_module_name
self.module_args = preserve_module_args
changed = False
if result.result.get('changed',False) or result2.result.get('changed',False):
changed = True
Expand Down Expand Up @@ -658,7 +665,7 @@ def _remote_md5(self, conn, tmp, path):

test = "rc=0; [ -r \"%s\" ] || rc=2; [ -f \"%s\" ] || rc=1" % (path,path)
md5s = [
"(/usr/bin/md5sum %s 2>/dev/null)" % path,
"(/usr/bin/md5sum %s | cut -c1-32 2>/dev/null)" % path,
"(/sbin/md5sum -q %s 2>/dev/null)" % path,
"(/usr/bin/digest -a md5 -v %s 2>/dev/null)" % path
]
Expand Down