GCP IAM Role (#53490)

* GCP IAM Role

* module util file

* test fix

* unit tests

* test fixes

* doc fragment fixes

* test fixes

* test fix
This commit is contained in:
Alex Stephen 2019-03-13 10:28:01 -07:00
parent e013828b2c
commit bef9f0e25e
7 changed files with 482 additions and 10 deletions

View file

@ -1,35 +1,49 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Google Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# GCP doc fragment.
DOCUMENTATION = '''
# GCP doc fragment.
DOCUMENTATION = r'''
options:
project:
description:
- The Google Cloud Platform project to use.
default: null
type: str
auth_kind:
description:
- The type of credential used.
type: str
required: true
choices: ["machineaccount", "serviceaccount", "application"]
choices: [ application, machineaccount, serviceaccount ]
service_account_contents:
description:
- A string representing the contents of a Service Account JSON file.
- This should not be passed in as a dictionary, but a string
that has the exact contents of a service account json file (valid JSON)
type: str
service_account_file:
description:
- The path of a Service Account JSON file if serviceaccount is selected as type.
type: path
service_account_email:
description:
- An optional service account email address if machineaccount is selected
and the user does not wish to use the default email.
type: str
scopes:
description:
- Array of scopes to be used.
description:
- Array of scopes to be used.
type: list
notes:
- For authentication, you can set service_account_file using the
C(GCP_SERVICE_ACCOUNT_FILE) env variable.
- For authentication, you can set service_account_email using the
C(GCP_SERVICE_ACCOUNT_EMAIL) env variable.
- For authentication, you can set service_account_contents using the
C(GCP_SERVICE_ACCOUNT_CONTENTS) env variable.
- For authentication, you can set auth_kind using the C(GCP_AUTH_KIND) env
variable.
- For authentication, you can set scopes using the C(GCP_SCOPES) env variable.