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,26 +76,26 @@ 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:
|
||||||
cost_center: ti-1700004
|
cost_center: ti-1700004
|
||||||
config: regional-us-central1
|
config: regional-us-central1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: instance
|
register: instance
|
||||||
|
|
||||||
- name: create a database
|
- name: create a database
|
||||||
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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -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 = '''
|
||||||
|
|
|
@ -85,16 +85,16 @@ notes:
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
gcp_spanner_instance:
|
gcp_spanner_instance:
|
||||||
name: testinstance
|
name: testinstance
|
||||||
display_name: My Spanner Instance
|
display_name: My Spanner Instance
|
||||||
node_count: 2
|
node_count: 2
|
||||||
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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -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 = '''
|
||||||
|
|
|
@ -74,29 +74,29 @@ extends_documentation_fragment: gcp
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-3"
|
name: "{{resource_name}}-3"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: instance
|
register: instance
|
||||||
|
|
||||||
- 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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -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 = '''
|
||||||
|
|
|
@ -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,31 +279,24 @@ 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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-2"
|
name: "{{resource_name}}-2"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -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'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -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 = '''
|
||||||
|
|
|
@ -75,30 +75,30 @@ extends_documentation_fragment: gcp
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-1"
|
name: "{{resource_name}}-1"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: instance
|
register: instance
|
||||||
|
|
||||||
- name: create a user
|
- name: create a user
|
||||||
gcp_sql_user:
|
gcp_sql_user:
|
||||||
name: test-user
|
name: test-user
|
||||||
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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -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 = '''
|
||||||
|
|
|
@ -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
|
||||||
|
@ -394,11 +341,11 @@ extends_documentation_fragment: gcp
|
||||||
EXAMPLES = '''
|
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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -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'))),
|
||||||
|
|
|
@ -108,22 +108,22 @@ extends_documentation_fragment: gcp
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: create a bucket
|
- name: create a bucket
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: bucket
|
register: bucket
|
||||||
|
|
||||||
- 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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -78,15 +78,15 @@ extends_documentation_fragment: gcp
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: create a object
|
- name: create a object
|
||||||
gcp_storage_object:
|
gcp_storage_object:
|
||||||
name: ansible-storage-module
|
name: ansible-storage-module
|
||||||
action: download
|
action: download
|
||||||
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
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -15,34 +15,34 @@
|
||||||
# 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:
|
||||||
cost_center: ti-1700004
|
cost_center: ti-1700004
|
||||||
config: regional-us-central1
|
config: regional-us-central1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: instance
|
register: instance
|
||||||
- name: delete a database
|
- name: delete a database
|
||||||
gcp_spanner_database:
|
gcp_spanner_database:
|
||||||
name: webstore
|
name: webstore
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a database
|
- name: create a database
|
||||||
gcp_spanner_database:
|
gcp_spanner_database:
|
||||||
name: webstore
|
name: webstore
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -64,12 +64,12 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a database that already exists
|
- name: create a database that already exists
|
||||||
gcp_spanner_database:
|
gcp_spanner_database:
|
||||||
name: webstore
|
name: webstore
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -78,12 +78,12 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a database
|
- name: delete a database
|
||||||
gcp_spanner_database:
|
gcp_spanner_database:
|
||||||
name: webstore
|
name: webstore
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -105,12 +105,12 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a database that does not exist
|
- name: delete a database that does not exist
|
||||||
gcp_spanner_database:
|
gcp_spanner_database:
|
||||||
name: webstore
|
name: webstore
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -121,15 +121,15 @@
|
||||||
# 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:
|
||||||
cost_center: ti-1700004
|
cost_center: ti-1700004
|
||||||
config: regional-us-central1
|
config: regional-us-central1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: instance
|
register: instance
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -15,29 +15,29 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: delete a instance
|
- name: delete a instance
|
||||||
gcp_spanner_instance:
|
gcp_spanner_instance:
|
||||||
name: testinstance
|
name: testinstance
|
||||||
display_name: My Spanner Instance
|
display_name: My Spanner Instance
|
||||||
node_count: 2
|
node_count: 2
|
||||||
labels:
|
labels:
|
||||||
cost_center: ti-1700004
|
cost_center: ti-1700004
|
||||||
config: regional-us-central1
|
config: regional-us-central1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
gcp_spanner_instance:
|
gcp_spanner_instance:
|
||||||
name: testinstance
|
name: testinstance
|
||||||
display_name: My Spanner Instance
|
display_name: My Spanner Instance
|
||||||
node_count: 2
|
node_count: 2
|
||||||
labels:
|
labels:
|
||||||
cost_center: ti-1700004
|
cost_center: ti-1700004
|
||||||
config: regional-us-central1
|
config: regional-us-central1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -58,16 +58,16 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a instance that already exists
|
- name: create a instance that already exists
|
||||||
gcp_spanner_instance:
|
gcp_spanner_instance:
|
||||||
name: testinstance
|
name: testinstance
|
||||||
display_name: My Spanner Instance
|
display_name: My Spanner Instance
|
||||||
node_count: 2
|
node_count: 2
|
||||||
labels:
|
labels:
|
||||||
cost_center: ti-1700004
|
cost_center: ti-1700004
|
||||||
config: regional-us-central1
|
config: regional-us-central1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -76,16 +76,16 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a instance
|
- name: delete a instance
|
||||||
gcp_spanner_instance:
|
gcp_spanner_instance:
|
||||||
name: testinstance
|
name: testinstance
|
||||||
display_name: My Spanner Instance
|
display_name: My Spanner Instance
|
||||||
node_count: 2
|
node_count: 2
|
||||||
labels:
|
labels:
|
||||||
cost_center: ti-1700004
|
cost_center: ti-1700004
|
||||||
config: regional-us-central1
|
config: regional-us-central1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -106,16 +106,16 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a instance that does not exist
|
- name: delete a instance that does not exist
|
||||||
gcp_spanner_instance:
|
gcp_spanner_instance:
|
||||||
name: testinstance
|
name: testinstance
|
||||||
display_name: My Spanner Instance
|
display_name: My Spanner Instance
|
||||||
node_count: 2
|
node_count: 2
|
||||||
labels:
|
labels:
|
||||||
cost_center: ti-1700004
|
cost_center: ti-1700004
|
||||||
config: regional-us-central1
|
config: regional-us-central1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -15,38 +15,38 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-3"
|
name: "{{resource_name}}-3"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: instance
|
register: instance
|
||||||
- name: delete a database
|
- name: delete a database
|
||||||
gcp_sql_database:
|
gcp_sql_database:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
charset: utf8
|
charset: utf8
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a database
|
- name: create a database
|
||||||
gcp_sql_database:
|
gcp_sql_database:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
charset: utf8
|
charset: utf8
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -69,13 +69,13 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a database that already exists
|
- name: create a database that already exists
|
||||||
gcp_sql_database:
|
gcp_sql_database:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
charset: utf8
|
charset: utf8
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -85,13 +85,13 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a database
|
- name: delete a database
|
||||||
gcp_sql_database:
|
gcp_sql_database:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
charset: utf8
|
charset: utf8
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -114,13 +114,13 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a database that does not exist
|
- name: delete a database that does not exist
|
||||||
gcp_sql_database:
|
gcp_sql_database:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
charset: utf8
|
charset: utf8
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -132,17 +132,17 @@
|
||||||
# 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_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-3"
|
name: "{{resource_name}}-3"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: instance
|
register: instance
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -15,33 +15,33 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: delete a instance
|
- name: delete a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-2"
|
name: "{{resource_name}}-2"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-2"
|
name: "{{resource_name}}-2"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -63,18 +63,18 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a instance that already exists
|
- name: create a instance that already exists
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-2"
|
name: "{{resource_name}}-2"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -84,18 +84,18 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a instance
|
- name: delete a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-2"
|
name: "{{resource_name}}-2"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -117,18 +117,18 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a instance that does not exist
|
- name: delete a instance that does not exist
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-2"
|
name: "{{resource_name}}-2"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -15,40 +15,40 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: create a instance
|
- name: create a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-1"
|
name: "{{resource_name}}-1"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: instance
|
register: instance
|
||||||
- name: delete a user
|
- name: delete a user
|
||||||
gcp_sql_user:
|
gcp_sql_user:
|
||||||
name: test-user
|
name: test-user
|
||||||
host: 10.1.2.3
|
host: 10.1.2.3
|
||||||
password: secret-password
|
password: secret-password
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a user
|
- name: create a user
|
||||||
gcp_sql_user:
|
gcp_sql_user:
|
||||||
name: test-user
|
name: test-user
|
||||||
host: 10.1.2.3
|
host: 10.1.2.3
|
||||||
password: secret-password
|
password: secret-password
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -71,14 +71,14 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a user that already exists
|
- name: create a user that already exists
|
||||||
gcp_sql_user:
|
gcp_sql_user:
|
||||||
name: test-user
|
name: test-user
|
||||||
host: 10.1.2.3
|
host: 10.1.2.3
|
||||||
password: secret-password
|
password: secret-password
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -88,14 +88,14 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a user
|
- name: delete a user
|
||||||
gcp_sql_user:
|
gcp_sql_user:
|
||||||
name: test-user
|
name: test-user
|
||||||
host: 10.1.2.3
|
host: 10.1.2.3
|
||||||
password: secret-password
|
password: secret-password
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -118,14 +118,14 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a user that does not exist
|
- name: delete a user that does not exist
|
||||||
gcp_sql_user:
|
gcp_sql_user:
|
||||||
name: test-user
|
name: test-user
|
||||||
host: 10.1.2.3
|
host: 10.1.2.3
|
||||||
password: secret-password
|
password: secret-password
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -137,17 +137,17 @@
|
||||||
# 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_sql_instance:
|
gcp_sql_instance:
|
||||||
name: "{{resource_name}}-1"
|
name: "{{resource_name}}-1"
|
||||||
settings:
|
settings:
|
||||||
ip_configuration:
|
ip_configuration:
|
||||||
authorized_networks:
|
authorized_networks:
|
||||||
- name: google dns server
|
- name: google dns server
|
||||||
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: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: instance
|
register: instance
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -15,19 +15,19 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: delete a bucket
|
- name: delete a bucket
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
name: ansible-storage-module
|
name: ansible-storage-module
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a bucket
|
- name: create a bucket
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
name: ansible-storage-module
|
name: ansible-storage-module
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -37,11 +37,11 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a bucket that already exists
|
- name: create a bucket that already exists
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
name: ansible-storage-module
|
name: ansible-storage-module
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -51,11 +51,11 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a bucket
|
- name: delete a bucket
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
name: ansible-storage-module
|
name: ansible-storage-module
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -65,11 +65,11 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a bucket that does not exist
|
- name: delete a bucket that does not exist
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
name: ansible-storage-module
|
name: ansible-storage-module
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -15,31 +15,31 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: create a bucket
|
- name: create a bucket
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: bucket
|
register: bucket
|
||||||
- name: delete a bucket access control
|
- name: delete a bucket access control
|
||||||
gcp_storage_bucket_access_control:
|
gcp_storage_bucket_access_control:
|
||||||
bucket: "{{ resource_name }}"
|
bucket: "{{ resource_name }}"
|
||||||
entity: user-alexstephen@google.com
|
entity: user-alexstephen@google.com
|
||||||
role: WRITER
|
role: WRITER
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a bucket access control
|
- name: create a bucket access control
|
||||||
gcp_storage_bucket_access_control:
|
gcp_storage_bucket_access_control:
|
||||||
bucket: "{{ resource_name }}"
|
bucket: "{{ resource_name }}"
|
||||||
entity: user-alexstephen@google.com
|
entity: user-alexstephen@google.com
|
||||||
role: WRITER
|
role: WRITER
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -49,13 +49,13 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a bucket access control that already exists
|
- name: create a bucket access control that already exists
|
||||||
gcp_storage_bucket_access_control:
|
gcp_storage_bucket_access_control:
|
||||||
bucket: "{{ resource_name }}"
|
bucket: "{{ resource_name }}"
|
||||||
entity: user-alexstephen@google.com
|
entity: user-alexstephen@google.com
|
||||||
role: WRITER
|
role: WRITER
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -65,13 +65,13 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a bucket access control
|
- name: delete a bucket access control
|
||||||
gcp_storage_bucket_access_control:
|
gcp_storage_bucket_access_control:
|
||||||
bucket: "{{ resource_name }}"
|
bucket: "{{ resource_name }}"
|
||||||
entity: user-alexstephen@google.com
|
entity: user-alexstephen@google.com
|
||||||
role: WRITER
|
role: WRITER
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -81,13 +81,13 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a bucket access control that does not exist
|
- name: delete a bucket access control that does not exist
|
||||||
gcp_storage_bucket_access_control:
|
gcp_storage_bucket_access_control:
|
||||||
bucket: "{{ resource_name }}"
|
bucket: "{{ resource_name }}"
|
||||||
entity: user-alexstephen@google.com
|
entity: user-alexstephen@google.com
|
||||||
role: WRITER
|
role: WRITER
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -99,10 +99,10 @@
|
||||||
# If errors happen, don't crash the playbook!
|
# If errors happen, don't crash the playbook!
|
||||||
- name: delete a bucket
|
- name: delete a bucket
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: bucket
|
register: bucket
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
Loading…
Reference in a new issue