mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
gcp: documentation update (#50183)
* gcp: documentation update * Update example about dynamic inventory * minor typo fixes in gcp_utils * Additional information about enabling inventory plugin in ansible.cfg partially fixes: #44404 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
a45063defe
commit
ae404d1476
2 changed files with 15 additions and 7 deletions
|
@ -63,7 +63,7 @@ def replace_resource_dict(item, value):
|
|||
return item.get(value)
|
||||
|
||||
|
||||
# Handles all authentation and HTTP sessions for GCP API calls.
|
||||
# Handles all authentication and HTTP sessions for GCP API calls.
|
||||
class GcpSession(object):
|
||||
def __init__(self, module, product):
|
||||
self.module = module
|
||||
|
@ -114,12 +114,12 @@ class GcpSession(object):
|
|||
|
||||
if self.module.params.get('service_account_email') is not None and self.module.params['auth_kind'] != 'machineaccount':
|
||||
self.module.fail_json(
|
||||
msg="Service Acccount Email only works with Machine Account-based authentication"
|
||||
msg="Service Account Email only works with Machine Account-based authentication"
|
||||
)
|
||||
|
||||
if self.module.params.get('service_account_file') is not None and self.module.params['auth_kind'] != 'serviceaccount':
|
||||
self.module.fail_json(
|
||||
msg="Service Acccount File only works with Service Account-based authentication"
|
||||
msg="Service Account File only works with Service Account-based authentication"
|
||||
)
|
||||
|
||||
def _credentials(self):
|
||||
|
@ -134,7 +134,7 @@ class GcpSession(object):
|
|||
return google.auth.compute_engine.Credentials(
|
||||
self.module.params['service_account_email'])
|
||||
else:
|
||||
self.module.fail_json(msg="Credential type '%s' not implmented" % cred_type)
|
||||
self.module.fail_json(msg="Credential type '%s' not implemented" % cred_type)
|
||||
|
||||
def _headers(self):
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue