From e23928cb4178b70d1c5ed343316546d6e714fc99 Mon Sep 17 00:00:00 2001 From: Prasad Katti Date: Mon, 13 Nov 2017 20:39:54 -0800 Subject: [PATCH] ec2_key: document return values (#32813) --- lib/ansible/modules/cloud/amazon/ec2_key.py | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/ec2_key.py b/lib/ansible/modules/cloud/amazon/ec2_key.py index 803df7e38f9..a37dbd3b29e 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_key.py +++ b/lib/ansible/modules/cloud/amazon/ec2_key.py @@ -102,6 +102,37 @@ EXAMPLES = ''' name: example state: absent ''' + +RETURN = ''' +changed: + description: whether a keypair was created/deleted + returned: always + type: bool + sample: true +key: + description: details of the keypair (this is set to null when state is absent) + returned: always + type: complex + contains: + fingerprint: + description: fingerprint of the key + returned: when state is present + type: string + sample: 'b0:22:49:61:d9:44:9d:0c:7e:ac:8a:32:93:21:6c:e8:fb:59:62:43' + name: + description: name of the keypair + returned: when state is present + type: string + sample: my_keypair + private_key: + description: private key of a newly created keypair + returned: when a new keypair is created by AWS (key_material is not provided) + type: string + sample: '-----BEGIN RSA PRIVATE KEY----- + MIIEowIBAAKC... + -----END RSA PRIVATE KEY-----' +''' + import random import string import time