|
|
@ -1020,7 +1020,13 @@ class AnsibleModule(object):
|
|
|
|
self.cleanup(tmp_dest.name)
|
|
|
|
self.cleanup(tmp_dest.name)
|
|
|
|
self.fail_json(msg='Could not replace file: %s to %s: %s' % (src, dest, e))
|
|
|
|
self.fail_json(msg='Could not replace file: %s to %s: %s' % (src, dest, e))
|
|
|
|
|
|
|
|
|
|
|
|
if creating and os.getenv("SUDO_USER"):
|
|
|
|
if creating:
|
|
|
|
|
|
|
|
# make sure the file has the correct permissions
|
|
|
|
|
|
|
|
# based on the current value of umask
|
|
|
|
|
|
|
|
umask = os.umask(0)
|
|
|
|
|
|
|
|
os.umask(umask)
|
|
|
|
|
|
|
|
os.chmod(dest, 0666 ^ umask)
|
|
|
|
|
|
|
|
if os.getenv("SUDO_USER"):
|
|
|
|
os.chown(dest, os.getuid(), os.getgid())
|
|
|
|
os.chown(dest, os.getuid(), os.getgid())
|
|
|
|
|
|
|
|
|
|
|
|
if self.selinux_enabled():
|
|
|
|
if self.selinux_enabled():
|
|
|
|