mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-28 07:31:29 -07:00
* sql ssl cert * date Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
b9b52fe3e1
commit
e672b351a3
7 changed files with 486 additions and 0 deletions
2
tests/integration/targets/gcp_sql_ssl_cert/aliases
Normal file
2
tests/integration/targets/gcp_sql_ssl_cert/aliases
Normal file
|
@ -0,0 +1,2 @@
|
|||
cloud/gcp
|
||||
unsupported
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
resource_name: "{{ resource_prefix }}"
|
0
tests/integration/targets/gcp_sql_ssl_cert/meta/main.yml
Normal file
0
tests/integration/targets/gcp_sql_ssl_cert/meta/main.yml
Normal file
87
tests/integration/targets/gcp_sql_ssl_cert/tasks/autogen.yml
Normal file
87
tests/integration/targets/gcp_sql_ssl_cert/tasks/autogen.yml
Normal file
|
@ -0,0 +1,87 @@
|
|||
---
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
# This file is automatically generated by Magic Modules and manual
|
||||
# changes will be clobbered when the file is regenerated.
|
||||
#
|
||||
# Please read more about how to change this file at
|
||||
# https://www.github.com/GoogleCloudPlatform/magic-modules
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# Pre-test setup
|
||||
- name: create a instance
|
||||
google.cloud.gcp_sql_instance:
|
||||
name: "{{resource_name}}-2"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: instance
|
||||
- name: delete a SSL cert
|
||||
google.cloud.gcp_sql_ssl_cert:
|
||||
common_name: "{{resource_name}}"
|
||||
instance: "{{instance['name'}}"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a SSL cert
|
||||
google.cloud.gcp_sql_ssl_cert:
|
||||
common_name: "{{resource_name}}"
|
||||
instance: "{{instance['name'}}"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
that:
|
||||
# SslCert is not altered, just verified.
|
||||
- result.changed == false
|
||||
- name: verify that ssl_cert was created
|
||||
google.cloud.gcp_sql_ssl_cert_info:
|
||||
filters:
|
||||
- name =
|
||||
instance: "{{instance['name'}}"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/sqlservice.admin
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['resources'] | length == 1
|
||||
#---------------------------------------------------------
|
||||
# Post-test teardown
|
||||
# If errors happen, don't crash the playbook!
|
||||
- name: delete a instance
|
||||
google.cloud.gcp_sql_instance:
|
||||
name: "{{resource_name}}-2"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
register: instance
|
||||
ignore_errors: true
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
- include_tasks: autogen.yml
|
Loading…
Add table
Add a link
Reference in a new issue