Ensure remote files are chmod'd properly for su/su_user too

Fixes #8594
This commit is contained in:
James Cammarata 2014-09-15 13:15:46 -05:00
parent 0c4a7492bf
commit cdf938f2c2
4 changed files with 4 additions and 4 deletions

View file

@ -227,7 +227,7 @@ class ActionModule(object):
self._remove_tempfile_if_content_defined(content, content_tempfile)
# fix file permissions when the copy is done as a different user
if self.runner.sudo and self.runner.sudo_user != 'root' and not raw:
if (self.runner.sudo and self.runner.sudo_user != 'root' or self.runner.su and self.runner.su_user != 'root') and not raw:
self.runner._remote_chmod(conn, 'a+r', tmp_src, tmp_path)
if raw: