mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-03 15:51:30 -07:00
Bug fixes for GCP modules (#53882)
This commit is contained in:
parent
b25a37bb38
commit
204ae88491
20 changed files with 486 additions and 560 deletions
|
@ -76,7 +76,7 @@ notes:
|
|||
EXAMPLES = '''
|
||||
- name: create a instance
|
||||
gcp_spanner_instance:
|
||||
name: "instance-database"
|
||||
name: instance-database
|
||||
display_name: My Spanner Instance
|
||||
node_count: 2
|
||||
labels:
|
||||
|
@ -92,8 +92,8 @@ EXAMPLES = '''
|
|||
gcp_spanner_database:
|
||||
name: webstore
|
||||
instance: "{{ instance }}"
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
|
|
@ -52,12 +52,13 @@ extends_documentation_fragment: gcp
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: a database facts
|
||||
- name: " a database facts"
|
||||
gcp_spanner_database_facts:
|
||||
instance: "{{ instance }}"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: facts
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -91,8 +91,8 @@ EXAMPLES = '''
|
|||
labels:
|
||||
cost_center: ti-1700004
|
||||
config: regional-us-central1
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
|
|
@ -44,11 +44,12 @@ extends_documentation_fragment: gcp
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: a instance facts
|
||||
- name: " a instance facts"
|
||||
gcp_spanner_instance_facts:
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: facts
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -90,11 +90,11 @@ EXAMPLES = '''
|
|||
|
||||
- name: create a database
|
||||
gcp_sql_database:
|
||||
name: "test_object"
|
||||
name: test_object
|
||||
charset: utf8
|
||||
instance: "{{ instance }}"
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
|
|
@ -52,12 +52,13 @@ extends_documentation_fragment: gcp
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: a database facts
|
||||
- name: " a database facts"
|
||||
gcp_sql_database_facts:
|
||||
instance: "{{ instance }}"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: facts
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -82,13 +82,6 @@ options:
|
|||
to Second Generation instances.
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- The name of the failover replica. If specified at instance creation, a failover
|
||||
|
@ -286,13 +279,6 @@ options:
|
|||
description:
|
||||
- Define the backup start time in UTC (HH:MM) .
|
||||
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
|
||||
'''
|
||||
|
||||
|
@ -307,8 +293,8 @@ EXAMPLES = '''
|
|||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
@ -624,7 +610,7 @@ def main():
|
|||
backend_type=dict(type='str', choices=['FIRST_GEN', 'SECOND_GEN', 'EXTERNAL']),
|
||||
connection_name=dict(type='str'),
|
||||
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']),
|
||||
ipv6_address=dict(type='str'),
|
||||
master_instance_name=dict(type='str'),
|
||||
|
@ -672,7 +658,6 @@ def main():
|
|||
backup_configuration=dict(
|
||||
type='dict', options=dict(enabled=dict(type='bool'), binary_log_enabled=dict(type='bool'), start_time=dict(type='str'))
|
||||
),
|
||||
settings_version=dict(type='int'),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
@ -44,11 +44,12 @@ extends_documentation_fragment: gcp
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: a instance facts
|
||||
- name: " a instance facts"
|
||||
gcp_sql_instance_facts:
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: facts
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -95,8 +95,8 @@ EXAMPLES = '''
|
|||
host: 10.1.2.3
|
||||
password: secret-password
|
||||
instance: "{{ instance }}"
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
|
|
@ -52,12 +52,13 @@ extends_documentation_fragment: gcp
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: a user facts
|
||||
- name: " a user facts"
|
||||
gcp_sql_user_facts:
|
||||
instance: "{{ instance }}"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: facts
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -65,14 +65,6 @@ options:
|
|||
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 }}"'
|
||||
required: true
|
||||
domain:
|
||||
description:
|
||||
- The domain associated with the entity.
|
||||
required: false
|
||||
email:
|
||||
description:
|
||||
- The email address associated with the entity.
|
||||
required: false
|
||||
entity:
|
||||
description:
|
||||
- 'The entity holding the permission, in one of the following forms: user-userId
|
||||
|
@ -87,10 +79,6 @@ options:
|
|||
description:
|
||||
- The ID for the entity.
|
||||
required: false
|
||||
id:
|
||||
description:
|
||||
- The ID of the access-control entry.
|
||||
required: false
|
||||
project_team:
|
||||
description:
|
||||
- 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
|
||||
task and then set this bucket field to "{{ name-of-resource }}"'
|
||||
required: true
|
||||
domain:
|
||||
description:
|
||||
- The domain associated with the entity.
|
||||
required: false
|
||||
email:
|
||||
description:
|
||||
- The email address associated with the entity.
|
||||
required: false
|
||||
entity:
|
||||
description:
|
||||
- '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 *
|
||||
allAuthenticatedUsers .'
|
||||
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:
|
||||
description:
|
||||
- The name of the object, if applied to an object.
|
||||
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:
|
||||
description:
|
||||
- The access permission for the entity.
|
||||
|
@ -313,10 +264,6 @@ options:
|
|||
description:
|
||||
- The entity, in the form project-owner-projectId.
|
||||
required: false
|
||||
entity_id:
|
||||
description:
|
||||
- The ID for the entity.
|
||||
required: false
|
||||
storage_class:
|
||||
description:
|
||||
- The bucket's default storage class, used whenever no storageClass is specified
|
||||
|
@ -395,8 +342,8 @@ EXAMPLES = '''
|
|||
- name: create a bucket
|
||||
gcp_storage_bucket:
|
||||
name: ansible-storage-module
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
@ -794,11 +741,8 @@ def main():
|
|||
elements='dict',
|
||||
options=dict(
|
||||
bucket=dict(required=True),
|
||||
domain=dict(type='str'),
|
||||
email=dict(type='str'),
|
||||
entity=dict(required=True, type='str'),
|
||||
entity_id=dict(type='str'),
|
||||
id=dict(type='str'),
|
||||
project_team=dict(
|
||||
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',
|
||||
options=dict(
|
||||
bucket=dict(required=True),
|
||||
domain=dict(type='str'),
|
||||
email=dict(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'),
|
||||
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']),
|
||||
),
|
||||
),
|
||||
|
@ -861,7 +797,7 @@ def main():
|
|||
logging=dict(type='dict', options=dict(log_bucket=dict(type='str'), log_object_prefix=dict(type='str'))),
|
||||
metageneration=dict(type='int'),
|
||||
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']),
|
||||
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'))),
|
||||
|
|
|
@ -117,11 +117,11 @@ EXAMPLES = '''
|
|||
|
||||
- name: create a bucket access control
|
||||
gcp_storage_bucket_access_control:
|
||||
bucket: "test_object"
|
||||
bucket: test_object
|
||||
entity: user-alexstephen@google.com
|
||||
role: WRITER
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
|
|
@ -83,8 +83,8 @@ EXAMPLES = '''
|
|||
bucket: ansible-bucket
|
||||
src: modules.zip
|
||||
dest: "~/modules.zip"
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# Pre-test setup
|
||||
- name: create a instance
|
||||
gcp_spanner_instance:
|
||||
name: "instance-database"
|
||||
name: instance-database
|
||||
display_name: My Spanner Instance
|
||||
node_count: 2
|
||||
labels:
|
||||
|
@ -121,7 +121,7 @@
|
|||
# If errors happen, don't crash the playbook!
|
||||
- name: delete a instance
|
||||
gcp_spanner_instance:
|
||||
name: "instance-database"
|
||||
name: instance-database
|
||||
display_name: My Spanner Instance
|
||||
node_count: 2
|
||||
labels:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue