fix sanity test issues

This commit is contained in:
durgesh-ninave-crest 2025-06-05 12:00:49 +05:30
commit ac08c81321
2 changed files with 49 additions and 46 deletions

View file

@ -5,8 +5,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = '''
author: author: Google Inc. (@googlecloudplatform)
- Dave Costakos <dcostako@redhat.com>
name: gcp_secret_manager name: gcp_secret_manager
short_description: Get Secrets from Google Cloud as a Lookup plugin short_description: Get Secrets from Google Cloud as a Lookup plugin
description: description:
@ -117,7 +116,8 @@ EXAMPLES = '''
- name: Test regional secret using explicit credentials - name: Test regional secret using explicit credentials
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ lookup('google.cloud.gcp_secret_manager', key='secret_key', location='us-central1', project='project', auth_kind='serviceaccount', service_account_file='file.json') }}" msg: "{{ lookup('google.cloud.gcp_secret_manager', key='secret_key', location='us-central1', project='project', auth_kind='serviceaccount',
service_account_file='file.json') }}"
- name: Test getting specific version of a regional secret (old version) - name: Test getting specific version of a regional secret (old version)
ansible.builtin.debug: ansible.builtin.debug:

View file

@ -1,4 +1,5 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt
# or https://www.gnu.org/licenses/gpl-3.0.txt) # or https://www.gnu.org/licenses/gpl-3.0.txt)
@ -26,7 +27,7 @@ description:
- Please note that other features like etags, replication, annontation expected to be managed outside of Ansible. - Please note that other features like etags, replication, annontation expected to be managed outside of Ansible.
- Deals with regional secrets if location option is defined. - Deals with regional secrets if location option is defined.
short_description: Access and Update Google Cloud Secrets Manager objects short_description: Access and Update Google Cloud Secrets Manager objects
author: Dave Costakos @RedHat author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
- requests >= 2.18.4 - requests >= 2.18.4
@ -121,6 +122,7 @@ options:
- only used in creation - only used in creation
- Note that the "value" piece of a label must contain only readable chars - Note that the "value" piece of a label must contain only readable chars
type: dict type: dict
default: {}
notes: notes:
- 'API Reference: U(https://cloud.google.com/secret-manager/docs/reference/rests)' - 'API Reference: U(https://cloud.google.com/secret-manager/docs/reference/rests)'
- 'Official Documentation: U(https://cloud.google.com/secret-manager/docs/overview)' - 'Official Documentation: U(https://cloud.google.com/secret-manager/docs/overview)'
@ -136,7 +138,7 @@ notes:
- The I(service_account_email) and I(service_account_file) options are mutually exclusive. - The I(service_account_email) and I(service_account_file) options are mutually exclusive.
''' '''
EXAMPLES = r''' EXAMPLES = '''
- name: Create a new secret - name: Create a new secret
google.cloud.gcp_secret_manager: google.cloud.gcp_secret_manager:
name: secret_key name: secret_key
@ -233,51 +235,52 @@ EXAMPLES = r'''
key_name: "ansible_rox" key_name: "ansible_rox"
''' '''
RETURN = r''' RETURN = '''
resources: resources:
description: List of resources description: List of resources
returned: always returned: always
type: complex type: complex
name: contains:
description: name:
- The name of the secret description:
returned: success - The name of the secret
type: str returned: success
location: type: str
description: location:
- The location of the regional secret. description:
returned: success - The location of the regional secret.
type: str returned: success
version: type: str
description: version:
- the version number of the secret returned description:
returned: success - The version number of the secret returned
type: str returned: success
url: type: str
description: url:
- the Google Cloud URL used to make the request description:
returned: success - The Google Cloud URL used to make the request
type: str returned: success
status_code: type: str
description: status_code:
- the HTTP status code of the response to Google Cloud description:
returned: success - The HTTP status code of the response to Google Cloud
type: str returned: success
msg: type: str
description: msg:
- A message indicating what was done (or not done) description:
returned: success, failure - A message indicating what was done (or not done)
type: str returned: success, failure
value: type: str
description: value:
- The decrypted secret value, please use care with this description:
returned: success - The decrypted secret value, please use care with this
type: str returned: success
payload: type: str
description: payload:
- The base 64 secret payload including CRC for validation description:
retunred: success - The base 64 secret payload including CRC for validation
type: dict returned: success
type: dict
''' '''
################################################################################ ################################################################################