From 6c88a80bd74c6961f800659f864ce83cde9ef9f5 Mon Sep 17 00:00:00 2001 From: Vincent Viallet Date: Fri, 14 Jun 2013 14:59:52 +0800 Subject: [PATCH] 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. --- cloud/do | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/do b/cloud/do index 33d705bee97..faec19eb02c 100644 --- a/cloud/do +++ b/cloud/do @@ -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())