diff --git a/lib/ansible/modules/cloud/azure/azure_rm_storageaccount_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_storageaccount_facts.py index 3c36c33ca4..4bef3f3ce0 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_storageaccount_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_storageaccount_facts.py @@ -40,6 +40,7 @@ options: show_connection_string: description: - Show the connection string for each of the storageaccount's endpoints. + - For convenient usage, C(show_connection_string) will also show the access keys for each of the storageaccount's endpoints. - Note that it will cost a lot of time when list all storageaccount rather than query a single one. type: bool version_added: "2.8" @@ -218,6 +219,10 @@ storageaccounts: description: - Connectionstring of the table endpoint sample: "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;TableEndpoint=X" + key: + description: + - The account key for the primary_endpoints + sample: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx secondary_endpoints: description: - Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location. @@ -263,6 +268,10 @@ storageaccounts: description: - Connectionstring of the table endpoint sample: "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;TableEndpoint=X" + key: + description: + - The account key for the secondary_endpoints + sample: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx tags: description: - Resource tags. @@ -409,6 +418,8 @@ class AzureRMStorageAccountFacts(AzureRMModuleBase): queue=self.format_endpoint_dict(account_dict['name'], account_key[0], account_obj.primary_endpoints.queue, 'queue'), table=self.format_endpoint_dict(account_dict['name'], account_key[0], account_obj.primary_endpoints.table, 'table') ) + if account_key[0]: + account_dict['primary_endpoints']['key'] = '{0}'.format(account_key[0]) account_dict['secondary_endpoints'] = None if account_obj.secondary_endpoints: account_dict['secondary_endpoints'] = dict( @@ -416,6 +427,8 @@ class AzureRMStorageAccountFacts(AzureRMModuleBase): queue=self.format_endpoint_dict(account_dict['name'], account_key[1], account_obj.primary_endpoints.queue, 'queue'), table=self.format_endpoint_dict(account_dict['name'], account_key[1], account_obj.primary_endpoints.table, 'table'), ) + if account_key[1]: + account_dict['secondary_endpoints']['key'] = '{0}'.format(account_key[1]) account_dict['tags'] = None if account_obj.tags: account_dict['tags'] = account_obj.tags