2018-08-22 19:00:15 +02:00
|
|
|
---
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# *** 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: delete a ssl policy
|
|
|
|
gcp_compute_ssl_policy:
|
2019-03-15 22:49:49 +01:00
|
|
|
name: "{{ resource_name }}"
|
|
|
|
profile: CUSTOM
|
|
|
|
min_tls_version: TLS_1_2
|
|
|
|
custom_features:
|
|
|
|
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
|
|
|
|
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
state: absent
|
2018-08-22 19:00:15 +02:00
|
|
|
#----------------------------------------------------------
|
|
|
|
- name: create a ssl policy
|
|
|
|
gcp_compute_ssl_policy:
|
2019-03-15 22:49:49 +01:00
|
|
|
name: "{{ resource_name }}"
|
|
|
|
profile: CUSTOM
|
|
|
|
min_tls_version: TLS_1_2
|
|
|
|
custom_features:
|
|
|
|
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
|
|
|
|
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
state: present
|
2018-08-22 19:00:15 +02:00
|
|
|
register: result
|
|
|
|
- name: assert changed is true
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- result.changed == true
|
|
|
|
- "result.kind == 'compute#sslPolicy'"
|
|
|
|
- name: verify that ssl_policy was created
|
|
|
|
gcp_compute_ssl_policy_facts:
|
|
|
|
filters:
|
|
|
|
- name = {{ resource_name }}
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
scopes:
|
|
|
|
- https://www.googleapis.com/auth/compute
|
|
|
|
register: results
|
|
|
|
- name: verify that command succeeded
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- results['items'] | length == 1
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
- name: create a ssl policy that already exists
|
|
|
|
gcp_compute_ssl_policy:
|
2019-03-15 22:49:49 +01:00
|
|
|
name: "{{ resource_name }}"
|
|
|
|
profile: CUSTOM
|
|
|
|
min_tls_version: TLS_1_2
|
|
|
|
custom_features:
|
|
|
|
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
|
|
|
|
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
state: present
|
2018-08-22 19:00:15 +02:00
|
|
|
register: result
|
|
|
|
- name: assert changed is false
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- result.changed == false
|
|
|
|
- "result.kind == 'compute#sslPolicy'"
|
|
|
|
#----------------------------------------------------------
|
|
|
|
- name: delete a ssl policy
|
|
|
|
gcp_compute_ssl_policy:
|
2019-03-15 22:49:49 +01:00
|
|
|
name: "{{ resource_name }}"
|
|
|
|
profile: CUSTOM
|
|
|
|
min_tls_version: TLS_1_2
|
|
|
|
custom_features:
|
|
|
|
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
|
|
|
|
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
state: absent
|
2018-08-22 19:00:15 +02:00
|
|
|
register: result
|
|
|
|
- name: assert changed is true
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- result.changed == true
|
|
|
|
- result.has_key('kind') == False
|
|
|
|
- name: verify that ssl_policy was deleted
|
|
|
|
gcp_compute_ssl_policy_facts:
|
|
|
|
filters:
|
|
|
|
- name = {{ resource_name }}
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
scopes:
|
|
|
|
- https://www.googleapis.com/auth/compute
|
|
|
|
register: results
|
|
|
|
- name: verify that command succeeded
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- results['items'] | length == 0
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
- name: delete a ssl policy that does not exist
|
|
|
|
gcp_compute_ssl_policy:
|
2019-03-15 22:49:49 +01:00
|
|
|
name: "{{ resource_name }}"
|
|
|
|
profile: CUSTOM
|
|
|
|
min_tls_version: TLS_1_2
|
|
|
|
custom_features:
|
|
|
|
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
|
|
|
|
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
state: absent
|
2018-08-22 19:00:15 +02:00
|
|
|
register: result
|
|
|
|
- name: assert changed is false
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- result.changed == false
|
|
|
|
- result.has_key('kind') == False
|