mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-02 00:33:09 +00:00
Set the options of an authorized key comma separated
According to the sshd man page, no spaces are permitted between the options of an authorized ssh key
This commit is contained in:
@@ -245,11 +245,15 @@ def writekeys(module, filename, keys):
|
||||
(keyhash,type,options,comment) = key
|
||||
option_str = ""
|
||||
if options:
|
||||
option_strings = []
|
||||
for option_key in options.keys():
|
||||
if options[option_key]:
|
||||
option_str += "%s=%s " % (option_key, options[option_key])
|
||||
option_strings.append("%s=%s" % (option_key, options[option_key]))
|
||||
else:
|
||||
option_str += "%s " % option_key
|
||||
option_strings.append("%s " % option_key)
|
||||
|
||||
option_str = ",".join(option_strings)
|
||||
option_str += " "
|
||||
key_line = "%s%s %s %s\n" % (option_str, type, keyhash, comment)
|
||||
except:
|
||||
key_line = key
|
||||
|
||||
Reference in New Issue
Block a user