mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
fix for authorized_key: skip chown and chmod if authorized_key_file is link
This commit is contained in:
@@ -140,8 +140,12 @@ def keyfile(module, user, write=False, path=None, manage_dir=True):
|
||||
if module.selinux_enabled():
|
||||
module.set_default_selinux_context(keysfile, False)
|
||||
|
||||
os.chown(keysfile, uid, gid)
|
||||
os.chmod(keysfile, 0600)
|
||||
try:
|
||||
os.chown(keysfile, uid, gid)
|
||||
os.chmod(keysfile, 0600)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
return keysfile
|
||||
|
||||
def readkeys(filename):
|
||||
|
||||
Reference in New Issue
Block a user