mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-02 16:53:11 +00:00
Allow keystring passed to authorized_key to contain blank lines and comments
This commit is contained in:
@@ -341,7 +341,9 @@ def enforce_state(module, params):
|
||||
state = params.get("state", "present")
|
||||
key_options = params.get("key_options", None)
|
||||
|
||||
key = key.split('\n')
|
||||
# extract indivial keys into an array, skipping blank lines and comments
|
||||
key = [s for s in key.splitlines() if s and not s.startswith('#')]
|
||||
|
||||
|
||||
# check current state -- just get the filename, don't create file
|
||||
do_write = False
|
||||
|
||||
Reference in New Issue
Block a user