Commit 66b5689a by Vincent Viallet Committed by Michael DeHaan

Ensure an existing ssh-key returns useful information (id + name) instead of a…

Ensure an existing ssh-key returns useful information (id + name) instead of a string; this way it can be used to register a variable to use in a later task.
parent 60d1ff12
......@@ -262,7 +262,7 @@ def core(module):
if state in ('active', 'present'):
key = SSH.find(name)
if key:
module.exit_json(changed=False, msg='SSH key with the name of %s already exists.' % name)
module.exit_json(changed=False, ssh_key=key.to_json())
key = SSH.add(name, getkeyordie('ssh_pub_key'))
module.exit_json(changed=True, ssh_key=key.to_json())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment