Bug fixes for GCP modules (#60092)
This commit is contained in:
parent
de8d428157
commit
0234937ca3
20 changed files with 5 additions and 29 deletions
|
@ -49,7 +49,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -49,7 +49,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -55,7 +55,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -49,7 +49,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -49,7 +49,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -186,8 +186,7 @@ def create(module, link):
|
||||||
|
|
||||||
|
|
||||||
def update(module, link):
|
def update(module, link):
|
||||||
delete(module, self_link(module))
|
module.fail_json(msg="Spanner objects can't be updated to ensure data safety")
|
||||||
create(module, collection(module))
|
|
||||||
|
|
||||||
|
|
||||||
def delete(module, link):
|
def delete(module, link):
|
||||||
|
|
|
@ -60,7 +60,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -202,8 +202,7 @@ def create(module, link):
|
||||||
|
|
||||||
|
|
||||||
def update(module, link):
|
def update(module, link):
|
||||||
auth = GcpSession(module, 'spanner')
|
module.fail_json(msg="Spanner objects can't be updated to ensure data safety")
|
||||||
return wait_for_operation(module, auth.patch(link, resource_to_update(module)))
|
|
||||||
|
|
||||||
|
|
||||||
def delete(module, link):
|
def delete(module, link):
|
||||||
|
|
|
@ -49,7 +49,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -187,8 +187,7 @@ def create(module, link, kind):
|
||||||
|
|
||||||
|
|
||||||
def update(module, link, kind):
|
def update(module, link, kind):
|
||||||
auth = GcpSession(module, 'sql')
|
module.fail_json(msg="SQL objects can't be updated to ensure data safety")
|
||||||
return wait_for_operation(module, auth.put(link, resource_to_request(module)))
|
|
||||||
|
|
||||||
|
|
||||||
def delete(module, link, kind):
|
def delete(module, link, kind):
|
||||||
|
|
|
@ -55,7 +55,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -763,8 +763,7 @@ def create(module, link, kind):
|
||||||
|
|
||||||
|
|
||||||
def update(module, link, kind, fetch):
|
def update(module, link, kind, fetch):
|
||||||
auth = GcpSession(module, 'sql')
|
module.fail_json(msg="SQL objects can't be updated to ensure data safety")
|
||||||
return wait_for_operation(module, auth.put(link, resource_to_request(module)))
|
|
||||||
|
|
||||||
|
|
||||||
def delete(module, link, kind, fetch):
|
def delete(module, link, kind, fetch):
|
||||||
|
|
|
@ -49,7 +49,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -215,7 +215,7 @@ def resource_to_request(module):
|
||||||
|
|
||||||
|
|
||||||
def unwrap_resource_filter(module):
|
def unwrap_resource_filter(module):
|
||||||
return {'host': module.params['host'], 'name': module.params['name']}
|
return {'name': module.params['name'], 'host': module.params['host']}
|
||||||
|
|
||||||
|
|
||||||
def unwrap_resource(result, module):
|
def unwrap_resource(result, module):
|
||||||
|
|
|
@ -60,7 +60,6 @@ EXAMPLES = '''
|
||||||
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 = '''
|
||||||
|
|
|
@ -52,7 +52,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- "result.kind == 'sql#database'"
|
|
||||||
- name: verify that database was created
|
- name: verify that database was created
|
||||||
gcp_sql_database_facts:
|
gcp_sql_database_facts:
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
|
@ -81,7 +80,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == false
|
- result.changed == false
|
||||||
- "result.kind == 'sql#database'"
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a database
|
- name: delete a database
|
||||||
gcp_sql_database:
|
gcp_sql_database:
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- "result.kind == 'sql#instance'"
|
|
||||||
- name: verify that instance was created
|
- name: verify that instance was created
|
||||||
gcp_sql_instance_facts:
|
gcp_sql_instance_facts:
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
|
@ -80,7 +79,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == false
|
- result.changed == false
|
||||||
- "result.kind == 'sql#instance'"
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a instance
|
- name: delete a instance
|
||||||
gcp_sql_instance:
|
gcp_sql_instance:
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- "result.kind == 'sql#user'"
|
|
||||||
- name: verify that user was created
|
- name: verify that user was created
|
||||||
gcp_sql_user_facts:
|
gcp_sql_user_facts:
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
|
@ -84,7 +83,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == false
|
- result.changed == false
|
||||||
- "result.kind == 'sql#user'"
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a user
|
- name: delete a user
|
||||||
gcp_sql_user:
|
gcp_sql_user:
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- "result.kind == 'storage#bucket'"
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a bucket that already exists
|
- name: create a bucket that already exists
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
|
@ -47,7 +46,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == false
|
- result.changed == false
|
||||||
- "result.kind == 'storage#bucket'"
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a bucket
|
- name: delete a bucket
|
||||||
gcp_storage_bucket:
|
gcp_storage_bucket:
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- "result.kind == 'storage#bucketAccessControl'"
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- 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:
|
||||||
|
@ -61,7 +60,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.changed == false
|
- result.changed == false
|
||||||
- "result.kind == 'storage#bucketAccessControl'"
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a bucket access control
|
- name: delete a bucket access control
|
||||||
gcp_storage_bucket_access_control:
|
gcp_storage_bucket_access_control:
|
||||||
|
|
Loading…
Reference in a new issue