From 176bf3cbb56a67295723864a04f179bcc3bd77d1 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 8 Aug 2012 19:17:31 -0400 Subject: [PATCH] Save extra chmod step if sudoing to root --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index cd1de901b7..2a5503ed31 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -318,7 +318,7 @@ class Runner(object): tmp_src = tmp + os.path.basename(source) conn.put_file(source, tmp_src) # fix file permissions when the copy is done as a different user - if self.sudo and self.sudo_user: + if self.sudo and self.sudo_user != 'root': self._low_level_exec_command(conn, "chmod a+r %s" % tmp_src, tmp) # run the copy module