Bug fixes for GCP modules (#53882)

This commit is contained in:
The Magician 2019-03-15 12:43:00 -07:00 committed by ansibot
parent b25a37bb38
commit 204ae88491
20 changed files with 486 additions and 560 deletions

View file

@ -76,7 +76,7 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- name: create a instance - name: create a instance
gcp_spanner_instance: gcp_spanner_instance:
name: "instance-database" name: instance-database
display_name: My Spanner Instance display_name: My Spanner Instance
node_count: 2 node_count: 2
labels: labels:
@ -92,8 +92,8 @@ EXAMPLES = '''
gcp_spanner_database: gcp_spanner_database:
name: webstore name: webstore
instance: "{{ instance }}" instance: "{{ instance }}"
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''

View file

@ -52,12 +52,13 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a database facts - name: " a database facts"
gcp_spanner_database_facts: gcp_spanner_database_facts:
instance: "{{ instance }}" instance: "{{ instance }}"
project: test_project project: test_project
auth_kind: serviceaccount auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: facts
''' '''
RETURN = ''' RETURN = '''

View file

@ -91,8 +91,8 @@ EXAMPLES = '''
labels: labels:
cost_center: ti-1700004 cost_center: ti-1700004
config: regional-us-central1 config: regional-us-central1
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''

View file

@ -44,11 +44,12 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a instance facts - name: " a instance facts"
gcp_spanner_instance_facts: gcp_spanner_instance_facts:
project: test_project project: test_project
auth_kind: serviceaccount auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: facts
''' '''
RETURN = ''' RETURN = '''

View file

@ -90,11 +90,11 @@ EXAMPLES = '''
- name: create a database - name: create a database
gcp_sql_database: gcp_sql_database:
name: "test_object" name: test_object
charset: utf8 charset: utf8
instance: "{{ instance }}" instance: "{{ instance }}"
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''

View file

@ -52,12 +52,13 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a database facts - name: " a database facts"
gcp_sql_database_facts: gcp_sql_database_facts:
instance: "{{ instance }}" instance: "{{ instance }}"
project: test_project project: test_project
auth_kind: serviceaccount auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: facts
''' '''
RETURN = ''' RETURN = '''

View file

@ -82,13 +82,6 @@ options:
to Second Generation instances. to Second Generation instances.
required: false required: false
suboptions: suboptions:
available:
description:
- The availability status of the failover replica. A false status indicates
that the failover replica is out of sync. The master can only failover to
the failover replica when the status is true.
required: false
type: bool
name: name:
description: description:
- The name of the failover replica. If specified at instance creation, a failover - The name of the failover replica. If specified at instance creation, a failover
@ -286,13 +279,6 @@ options:
description: description:
- Define the backup start time in UTC (HH:MM) . - Define the backup start time in UTC (HH:MM) .
required: false required: false
settings_version:
description:
- The version of instance settings. This is a required field for update method
to make sure concurrent updates are handled properly. During update, use
the most recent settingsVersion value for this instance and do not try to
update this value.
required: false
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
''' '''
@ -307,8 +293,8 @@ EXAMPLES = '''
value: 8.8.8.8/32 value: 8.8.8.8/32
tier: db-n1-standard-1 tier: db-n1-standard-1
region: us-central1 region: us-central1
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''
@ -624,7 +610,7 @@ def main():
backend_type=dict(type='str', choices=['FIRST_GEN', 'SECOND_GEN', 'EXTERNAL']), backend_type=dict(type='str', choices=['FIRST_GEN', 'SECOND_GEN', 'EXTERNAL']),
connection_name=dict(type='str'), connection_name=dict(type='str'),
database_version=dict(type='str', choices=['MYSQL_5_5', 'MYSQL_5_6', 'MYSQL_5_7', 'POSTGRES_9_6']), database_version=dict(type='str', choices=['MYSQL_5_5', 'MYSQL_5_6', 'MYSQL_5_7', 'POSTGRES_9_6']),
failover_replica=dict(type='dict', options=dict(available=dict(type='bool'), name=dict(type='str'))), failover_replica=dict(type='dict', options=dict(name=dict(type='str'))),
instance_type=dict(type='str', choices=['CLOUD_SQL_INSTANCE', 'ON_PREMISES_INSTANCE', 'READ_REPLICA_INSTANCE']), instance_type=dict(type='str', choices=['CLOUD_SQL_INSTANCE', 'ON_PREMISES_INSTANCE', 'READ_REPLICA_INSTANCE']),
ipv6_address=dict(type='str'), ipv6_address=dict(type='str'),
master_instance_name=dict(type='str'), master_instance_name=dict(type='str'),
@ -672,7 +658,6 @@ def main():
backup_configuration=dict( backup_configuration=dict(
type='dict', options=dict(enabled=dict(type='bool'), binary_log_enabled=dict(type='bool'), start_time=dict(type='str')) type='dict', options=dict(enabled=dict(type='bool'), binary_log_enabled=dict(type='bool'), start_time=dict(type='str'))
), ),
settings_version=dict(type='int'),
), ),
), ),
) )

View file

@ -44,11 +44,12 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a instance facts - name: " a instance facts"
gcp_sql_instance_facts: gcp_sql_instance_facts:
project: test_project project: test_project
auth_kind: serviceaccount auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: facts
''' '''
RETURN = ''' RETURN = '''

View file

@ -95,8 +95,8 @@ EXAMPLES = '''
host: 10.1.2.3 host: 10.1.2.3
password: secret-password password: secret-password
instance: "{{ instance }}" instance: "{{ instance }}"
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''

View file

@ -52,12 +52,13 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a user facts - name: " a user facts"
gcp_sql_user_facts: gcp_sql_user_facts:
instance: "{{ instance }}" instance: "{{ instance }}"
project: test_project project: test_project
auth_kind: serviceaccount auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: facts
''' '''
RETURN = ''' RETURN = '''

View file

@ -65,14 +65,6 @@ options:
string Alternatively, you can add `register: name-of-resource` to a gcp_storage_bucket string Alternatively, you can add `register: name-of-resource` to a gcp_storage_bucket
task and then set this bucket field to "{{ name-of-resource }}"' task and then set this bucket field to "{{ name-of-resource }}"'
required: true required: true
domain:
description:
- The domain associated with the entity.
required: false
email:
description:
- The email address associated with the entity.
required: false
entity: entity:
description: description:
- 'The entity holding the permission, in one of the following forms: user-userId - 'The entity holding the permission, in one of the following forms: user-userId
@ -87,10 +79,6 @@ options:
description: description:
- The ID for the entity. - The ID for the entity.
required: false required: false
id:
description:
- The ID of the access-control entry.
required: false
project_team: project_team:
description: description:
- The project team associated with the entity. - The project team associated with the entity.
@ -156,14 +144,6 @@ options:
string Alternatively, you can add `register: name-of-resource` to a gcp_storage_bucket string Alternatively, you can add `register: name-of-resource` to a gcp_storage_bucket
task and then set this bucket field to "{{ name-of-resource }}"' task and then set this bucket field to "{{ name-of-resource }}"'
required: true required: true
domain:
description:
- The domain associated with the entity.
required: false
email:
description:
- The email address associated with the entity.
required: false
entity: entity:
description: description:
- 'The entity holding the permission, in one of the following forms: * user-{{userId}} - 'The entity holding the permission, in one of the following forms: * user-{{userId}}
@ -172,39 +152,10 @@ options:
(such as "domain-example.com") * project-team-{{projectId}} * allUsers * (such as "domain-example.com") * project-team-{{projectId}} * allUsers *
allAuthenticatedUsers .' allAuthenticatedUsers .'
required: true required: true
entity_id:
description:
- The ID for the entity.
required: false
generation:
description:
- The content generation of the object, if applied to an object.
required: false
id:
description:
- The ID of the access-control entry.
required: false
object: object:
description: description:
- The name of the object, if applied to an object. - The name of the object, if applied to an object.
required: false required: false
project_team:
description:
- The project team associated with the entity.
required: false
suboptions:
project_number:
description:
- The project team associated with the entity.
required: false
team:
description:
- The team.
required: false
choices:
- editors
- owners
- viewers
role: role:
description: description:
- The access permission for the entity. - The access permission for the entity.
@ -313,10 +264,6 @@ options:
description: description:
- The entity, in the form project-owner-projectId. - The entity, in the form project-owner-projectId.
required: false required: false
entity_id:
description:
- The ID for the entity.
required: false
storage_class: storage_class:
description: description:
- The bucket's default storage class, used whenever no storageClass is specified - The bucket's default storage class, used whenever no storageClass is specified
@ -395,8 +342,8 @@ EXAMPLES = '''
- name: create a bucket - name: create a bucket
gcp_storage_bucket: gcp_storage_bucket:
name: ansible-storage-module name: ansible-storage-module
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''
@ -794,11 +741,8 @@ def main():
elements='dict', elements='dict',
options=dict( options=dict(
bucket=dict(required=True), bucket=dict(required=True),
domain=dict(type='str'),
email=dict(type='str'),
entity=dict(required=True, type='str'), entity=dict(required=True, type='str'),
entity_id=dict(type='str'), entity_id=dict(type='str'),
id=dict(type='str'),
project_team=dict( project_team=dict(
type='dict', options=dict(project_number=dict(type='str'), team=dict(type='str', choices=['editors', 'owners', 'viewers'])) type='dict', options=dict(project_number=dict(type='str'), team=dict(type='str', choices=['editors', 'owners', 'viewers']))
), ),
@ -820,16 +764,8 @@ def main():
elements='dict', elements='dict',
options=dict( options=dict(
bucket=dict(required=True), bucket=dict(required=True),
domain=dict(type='str'),
email=dict(type='str'),
entity=dict(required=True, type='str'), entity=dict(required=True, type='str'),
entity_id=dict(type='str'),
generation=dict(type='int'),
id=dict(type='str'),
object=dict(type='str'), object=dict(type='str'),
project_team=dict(
type='dict', options=dict(project_number=dict(type='str'), team=dict(type='str', choices=['editors', 'owners', 'viewers']))
),
role=dict(required=True, type='str', choices=['OWNER', 'READER']), role=dict(required=True, type='str', choices=['OWNER', 'READER']),
), ),
), ),
@ -861,7 +797,7 @@ def main():
logging=dict(type='dict', options=dict(log_bucket=dict(type='str'), log_object_prefix=dict(type='str'))), logging=dict(type='dict', options=dict(log_bucket=dict(type='str'), log_object_prefix=dict(type='str'))),
metageneration=dict(type='int'), metageneration=dict(type='int'),
name=dict(type='str'), name=dict(type='str'),
owner=dict(type='dict', options=dict(entity=dict(type='str'), entity_id=dict(type='str'))), owner=dict(type='dict', options=dict(entity=dict(type='str'))),
storage_class=dict(type='str', choices=['MULTI_REGIONAL', 'REGIONAL', 'STANDARD', 'NEARLINE', 'COLDLINE', 'DURABLE_REDUCED_AVAILABILITY']), storage_class=dict(type='str', choices=['MULTI_REGIONAL', 'REGIONAL', 'STANDARD', 'NEARLINE', 'COLDLINE', 'DURABLE_REDUCED_AVAILABILITY']),
versioning=dict(type='dict', options=dict(enabled=dict(type='bool'))), versioning=dict(type='dict', options=dict(enabled=dict(type='bool'))),
website=dict(type='dict', options=dict(main_page_suffix=dict(type='str'), not_found_page=dict(type='str'))), website=dict(type='dict', options=dict(main_page_suffix=dict(type='str'), not_found_page=dict(type='str'))),

View file

@ -117,11 +117,11 @@ EXAMPLES = '''
- name: create a bucket access control - name: create a bucket access control
gcp_storage_bucket_access_control: gcp_storage_bucket_access_control:
bucket: "test_object" bucket: test_object
entity: user-alexstephen@google.com entity: user-alexstephen@google.com
role: WRITER role: WRITER
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''

View file

@ -83,8 +83,8 @@ EXAMPLES = '''
bucket: ansible-bucket bucket: ansible-bucket
src: modules.zip src: modules.zip
dest: "~/modules.zip" dest: "~/modules.zip"
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a instance - name: create a instance
gcp_spanner_instance: gcp_spanner_instance:
name: "instance-database" name: instance-database
display_name: My Spanner Instance display_name: My Spanner Instance
node_count: 2 node_count: 2
labels: labels:
@ -121,7 +121,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a instance - name: delete a instance
gcp_spanner_instance: gcp_spanner_instance:
name: "instance-database" name: instance-database
display_name: My Spanner Instance display_name: My Spanner Instance
node_count: 2 node_count: 2
labels: labels: