From 92fd49de771b9259905c42e0ac60281c14d40d82 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 15 Mar 2019 14:49:49 -0700 Subject: [PATCH] Bug fixes for GCP modules (#53880) --- .../cloud/google/gcp_compute_router.py | 40 +-- .../cloud/google/gcp_compute_router_facts.py | 15 +- .../google/gcp_compute_ssl_certificate.py | 48 ++- .../gcp_compute_ssl_certificate_facts.py | 13 +- .../cloud/google/gcp_compute_ssl_policy.py | 20 +- .../google/gcp_compute_ssl_policy_facts.py | 13 +- .../cloud/google/gcp_compute_subnetwork.py | 28 +- .../google/gcp_compute_subnetwork_facts.py | 15 +- .../google/gcp_compute_target_http_proxy.py | 76 ++--- .../gcp_compute_target_http_proxy_facts.py | 13 +- .../google/gcp_compute_target_https_proxy.py | 128 ++++---- .../gcp_compute_target_https_proxy_facts.py | 13 +- .../cloud/google/gcp_compute_target_pool.py | 12 +- .../google/gcp_compute_target_pool_facts.py | 15 +- .../google/gcp_compute_target_ssl_proxy.py | 124 ++++---- .../gcp_compute_target_ssl_proxy_facts.py | 13 +- .../google/gcp_compute_target_tcp_proxy.py | 74 ++--- .../gcp_compute_target_tcp_proxy_facts.py | 13 +- .../google/gcp_compute_target_vpn_gateway.py | 36 +-- .../gcp_compute_target_vpn_gateway_facts.py | 15 +- .../cloud/google/gcp_compute_url_map.py | 62 ++-- .../cloud/google/gcp_compute_url_map_facts.py | 13 +- .../cloud/google/gcp_compute_vpn_tunnel.py | 72 ++--- .../targets/gcp_compute_router/tasks/main.yml | 170 +++++----- .../tasks/main.yml | 240 ++++++-------- .../gcp_compute_ssl_policy/tasks/main.yml | 100 +++--- .../gcp_compute_subnetwork/tasks/main.yml | 104 +++--- .../tasks/main.yml | 184 +++++------ .../tasks/main.yml | 300 ++++++++---------- .../gcp_compute_target_pool/tasks/main.yml | 60 ++-- .../tasks/main.yml | 292 ++++++++--------- .../tasks/main.yml | 186 +++++------ .../tasks/main.yml | 114 +++---- .../gcp_compute_url_map/tasks/main.yml | 160 +++++----- .../gcp_compute_vpn_tunnel/tasks/main.yml | 198 ++++++------ 35 files changed, 1423 insertions(+), 1556 deletions(-) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_router.py b/lib/ansible/modules/cloud/google/gcp_compute_router.py index 9977375cb0..83ecca83de 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_router.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_router.py @@ -126,30 +126,30 @@ notes: EXAMPLES = ''' - name: create a network gcp_compute_network: - name: "network-router" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-router + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: create a router gcp_compute_router: - name: "test_object" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_router_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_router_facts.py index 1ef82f2e04..45c00d8af7 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_router_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_router_facts.py @@ -53,14 +53,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a router facts +- name: " a router facts" gcp_compute_router_facts: - region: us-central1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-central1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py index c2b2e04949..8a4e6ae79c 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py @@ -81,36 +81,24 @@ notes: EXAMPLES = ''' - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "test_object" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py index 51e16a94b4..12c1704e36 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a ssl certificate facts +- name: " a ssl certificate facts" gcp_compute_ssl_certificate_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py index 02def517b0..329ec37fa3 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py @@ -98,16 +98,16 @@ notes: EXAMPLES = ''' - name: create a ssl policy gcp_compute_ssl_policy: - name: "test_object" - 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: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + 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: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py index c620ec05b8..22758a32d5 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a ssl policy facts +- name: " a ssl policy facts" gcp_compute_ssl_policy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py index 3097e9abf6..5f4762a2b1 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py @@ -140,24 +140,24 @@ notes: EXAMPLES = ''' - name: create a network gcp_compute_network: - name: "network-subnetwork" - auto_create_subnetworks: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-subnetwork + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: create a subnetwork gcp_compute_subnetwork: - name: ansiblenet - region: us-west1 - network: "{{ network }}" - ip_cidr_range: 172.16.0.0/16 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py index 77de9f76fc..9d24ddd967 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py @@ -53,14 +53,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a subnetwork facts +- name: " a subnetwork facts" gcp_compute_subnetwork_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py index ec150e13d4..3e69a973f5 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py @@ -72,66 +72,66 @@ options: required: true extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/targetHttpProxies)' - 'Official Documentation: U(https://cloud.google.com/compute/docs/load-balancing/http/target-proxies)' ''' EXAMPLES = ''' - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-targethttpproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-targethttpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-targethttpproxy" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-targethttpproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-targethttpproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-targethttpproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a url map gcp_compute_url_map: - name: "urlmap-targethttpproxy" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: urlmap-targethttpproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: urlmap - name: create a target http proxy gcp_compute_target_http_proxy: - name: "test_object" - url_map: "{{ urlmap }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + url_map: "{{ urlmap }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py index b7f56b9c6f..1a6e68af68 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a target http proxy facts +- name: " a target http proxy facts" gcp_compute_target_http_proxy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py index 229d81a4d7..c9dd72cfe1 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py @@ -102,102 +102,90 @@ options: required: true extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/targetHttpsProxies)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/targetHttpsProxies)' - 'Official Documentation: U(https://cloud.google.com/compute/docs/load-balancing/http/target-proxies)' ''' EXAMPLES = ''' - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-targethttpsproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-targethttpsproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-targethttpsproxy" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-targethttpsproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-targethttpsproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-targethttpsproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a url map gcp_compute_url_map: - name: "urlmap-targethttpsproxy" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: urlmap-targethttpsproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: urlmap - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targethttpsproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: sslcert-targethttpsproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: sslcert - name: create a target https proxy gcp_compute_target_https_proxy: - name: "test_object" - ssl_certificates: - - "{{ sslcert }}" - url_map: "{{ urlmap }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py index e68a89728d..bd79ec0d85 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a target https proxy facts +- name: " a target https proxy facts" gcp_compute_target_https_proxy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py b/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py index 89afc7701a..270e1a03ed 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py @@ -135,12 +135,12 @@ notes: EXAMPLES = ''' - name: create a target pool gcp_compute_target_pool: - name: "test_object" - region: us-west1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-west1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py index 05332d6a11..48923e1407 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py @@ -53,14 +53,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a target pool facts +- name: " a target pool facts" gcp_compute_target_pool_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py index 0e00b0b15b..ec6f54ccc2 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py @@ -97,96 +97,84 @@ options: version_added: 2.8 extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/targetSslProxies)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/targetSslProxies)' - 'Setting Up SSL proxy for Google Cloud Load Balancing: U(https://cloud.google.com/compute/docs/load-balancing/tcp-ssl/)' ''' EXAMPLES = ''' - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-targetsslproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-targetsslproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a health check gcp_compute_health_check: - name: "healthcheck-targetsslproxy" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: healthcheck-targetsslproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-targetsslproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - protocol: SSL - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-targetsslproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: SSL + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targetsslproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: sslcert-targetsslproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: sslcert - name: create a target ssl proxy gcp_compute_target_ssl_proxy: - name: "test_object" - ssl_certificates: - - "{{ sslcert }}" - service: "{{ backendservice }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py index 237ed188bf..fe582bfccf 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a target ssl proxy facts +- name: " a target ssl proxy facts" gcp_compute_target_ssl_proxy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py index 1a4679f713..b10ace3174 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py @@ -80,61 +80,61 @@ options: required: true extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/targetTcpProxies)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/targetTcpProxies)' - 'Setting Up TCP proxy for Google Cloud Load Balancing: U(https://cloud.google.com/compute/docs/load-balancing/tcp-ssl/tcp-proxy)' ''' EXAMPLES = ''' - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-targettcpproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-targettcpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a health check gcp_compute_health_check: - name: "healthcheck-targettcpproxy" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: healthcheck-targettcpproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-targettcpproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - protocol: TCP - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-targettcpproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: TCP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a target tcp proxy gcp_compute_target_tcp_proxy: - name: "test_object" - proxy_header: PROXY_V1 - service: "{{ backendservice }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py index 82c16cc1ab..f563a0b8bf 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a target tcp proxy facts +- name: " a target tcp proxy facts" gcp_compute_target_tcp_proxy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py index 2ab6321c15..9bf4d8c214 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py @@ -81,32 +81,32 @@ notes: EXAMPLES = ''' - name: create a address gcp_compute_address: - name: "address-vpngateway" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: address-vpngateway + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: address - name: create a network gcp_compute_network: - name: "network-vpngateway" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-vpngateway + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: create a target vpn gateway gcp_compute_target_vpn_gateway: - name: "test_object" - region: us-west1 - network: "{{ network }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-west1 + network: "{{ network }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py index cdb5992650..09c6913ee6 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py @@ -53,14 +53,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a target vpn gateway facts +- name: " a target vpn gateway facts" gcp_compute_target_vpn_gateway_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_url_map.py b/lib/ansible/modules/cloud/google/gcp_compute_url_map.py index 4410306ffa..5d0c6bd193 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_url_map.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_url_map.py @@ -170,49 +170,49 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-urlmap" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-urlmap + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-urlmap" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-urlmap + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-urlmap" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-urlmap + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a url map gcp_compute_url_map: - name: "test_object" - default_service: "{{ backendservice }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + default_service: "{{ backendservice }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py index 11116766b7..2fd5175a96 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a url map facts +- name: " a url map facts" gcp_compute_url_map_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py b/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py index b01e884e96..18c651928a 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py @@ -123,54 +123,54 @@ notes: EXAMPLES = ''' - name: create a network gcp_compute_network: - name: "network-vpn-tunnel" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-vpn-tunnel + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: create a router gcp_compute_router: - name: "router-vpn-tunnel" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: router-vpn-tunnel + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: router - name: create a target vpn gateway gcp_compute_target_vpn_gateway: - name: "gateway-vpn-tunnel" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: gateway-vpn-tunnel + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: gateway - name: create a vpn tunnel gcp_compute_vpn_tunnel: - name: "test_object" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/test/integration/targets/gcp_compute_router/tasks/main.yml b/test/integration/targets/gcp_compute_router/tasks/main.yml index bad78bd73f..ac9e5f57b0 100644 --- a/test/integration/targets/gcp_compute_router/tasks/main.yml +++ b/test/integration/targets/gcp_compute_router/tasks/main.yml @@ -15,47 +15,47 @@ # Pre-test setup - name: create a network gcp_compute_network: - name: "network-router" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-router + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: delete a router gcp_compute_router: - name: "{{ resource_name }}" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a router gcp_compute_router: - name: "{{ resource_name }}" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -80,21 +80,21 @@ # ---------------------------------------------------------------------------- - name: create a router that already exists gcp_compute_router: - name: "{{ resource_name }}" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -104,21 +104,21 @@ #---------------------------------------------------------- - name: delete a router gcp_compute_router: - name: "{{ resource_name }}" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -143,21 +143,21 @@ # ---------------------------------------------------------------------------- - name: delete a router that does not exist gcp_compute_router: - name: "{{ resource_name }}" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -169,10 +169,10 @@ # If errors happen, don't crash the playbook! - name: delete a network gcp_compute_network: - name: "network-router" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: network-router + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: network ignore_errors: true diff --git a/test/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml b/test/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml index 5350f6a72c..467b1c418d 100644 --- a/test/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml +++ b/test/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml @@ -15,69 +15,45 @@ # Pre-test setup - name: delete a ssl certificate gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -101,36 +77,24 @@ # ---------------------------------------------------------------------------- - name: create a ssl certificate that already exists gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -140,36 +104,24 @@ #---------------------------------------------------------- - name: delete a ssl certificate gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -193,36 +145,24 @@ # ---------------------------------------------------------------------------- - name: delete a ssl certificate that does not exist gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/test/integration/targets/gcp_compute_ssl_policy/tasks/main.yml b/test/integration/targets/gcp_compute_ssl_policy/tasks/main.yml index 20d3a8c3f7..05bd52f636 100644 --- a/test/integration/targets/gcp_compute_ssl_policy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_ssl_policy/tasks/main.yml @@ -15,29 +15,29 @@ # Pre-test setup - name: delete a ssl policy gcp_compute_ssl_policy: - 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 + 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 #---------------------------------------------------------- - name: create a ssl policy gcp_compute_ssl_policy: - 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 + 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 register: result - name: assert changed is true assert: @@ -61,16 +61,16 @@ # ---------------------------------------------------------------------------- - name: create a ssl policy that already exists gcp_compute_ssl_policy: - 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 + 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 register: result - name: assert changed is false assert: @@ -80,16 +80,16 @@ #---------------------------------------------------------- - name: delete a ssl policy gcp_compute_ssl_policy: - 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 + 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 register: result - name: assert changed is true assert: @@ -113,16 +113,16 @@ # ---------------------------------------------------------------------------- - name: delete a ssl policy that does not exist gcp_compute_ssl_policy: - 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 + 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 register: result - name: assert changed is false assert: diff --git a/test/integration/targets/gcp_compute_subnetwork/tasks/main.yml b/test/integration/targets/gcp_compute_subnetwork/tasks/main.yml index 6c0eeb5dbb..ffcca46aea 100644 --- a/test/integration/targets/gcp_compute_subnetwork/tasks/main.yml +++ b/test/integration/targets/gcp_compute_subnetwork/tasks/main.yml @@ -15,34 +15,34 @@ # Pre-test setup - name: create a network gcp_compute_network: - name: "network-subnetwork" - auto_create_subnetworks: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-subnetwork + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: delete a subnetwork gcp_compute_subnetwork: - name: ansiblenet - region: us-west1 - network: "{{ network }}" - ip_cidr_range: 172.16.0.0/16 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a subnetwork gcp_compute_subnetwork: - name: ansiblenet - region: us-west1 - network: "{{ network }}" - ip_cidr_range: 172.16.0.0/16 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -67,14 +67,14 @@ # ---------------------------------------------------------------------------- - name: create a subnetwork that already exists gcp_compute_subnetwork: - name: ansiblenet - region: us-west1 - network: "{{ network }}" - ip_cidr_range: 172.16.0.0/16 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -84,14 +84,14 @@ #---------------------------------------------------------- - name: delete a subnetwork gcp_compute_subnetwork: - name: ansiblenet - region: us-west1 - network: "{{ network }}" - ip_cidr_range: 172.16.0.0/16 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -116,14 +116,14 @@ # ---------------------------------------------------------------------------- - name: delete a subnetwork that does not exist gcp_compute_subnetwork: - name: ansiblenet - region: us-west1 - network: "{{ network }}" - ip_cidr_range: 172.16.0.0/16 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -135,11 +135,11 @@ # If errors happen, don't crash the playbook! - name: delete a network gcp_compute_network: - name: "network-subnetwork" - auto_create_subnetworks: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: network-subnetwork + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: network ignore_errors: true diff --git a/test/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml b/test/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml index cee3802ba2..a5182a7224 100644 --- a/test/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml @@ -15,64 +15,64 @@ # Pre-test setup - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-targethttpproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-targethttpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-targethttpproxy" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-targethttpproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-targethttpproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-targethttpproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a url map gcp_compute_url_map: - name: "urlmap-targethttpproxy" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: urlmap-targethttpproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: urlmap - name: delete a target http proxy gcp_compute_target_http_proxy: - name: "{{ resource_name }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a target http proxy gcp_compute_target_http_proxy: - name: "{{ resource_name }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -96,12 +96,12 @@ # ---------------------------------------------------------------------------- - name: create a target http proxy that already exists gcp_compute_target_http_proxy: - name: "{{ resource_name }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -111,12 +111,12 @@ #---------------------------------------------------------- - name: delete a target http proxy gcp_compute_target_http_proxy: - name: "{{ resource_name }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -140,12 +140,12 @@ # ---------------------------------------------------------------------------- - name: delete a target http proxy that does not exist gcp_compute_target_http_proxy: - name: "{{ resource_name }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -157,48 +157,48 @@ # If errors happen, don't crash the playbook! - name: delete a url map gcp_compute_url_map: - name: "urlmap-targethttpproxy" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: urlmap-targethttpproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: urlmap ignore_errors: true - name: delete a backend service gcp_compute_backend_service: - name: "backendservice-targethttpproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: backendservice-targethttpproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: backendservice ignore_errors: true - name: delete a http health check gcp_compute_http_health_check: - name: "httphealthcheck-targethttpproxy" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: httphealthcheck-targethttpproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: healthcheck ignore_errors: true - name: delete a instance group gcp_compute_instance_group: - name: "instancegroup-targethttpproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instancegroup-targethttpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instancegroup ignore_errors: true diff --git a/test/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml b/test/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml index 7a50dc4304..144bf956fa 100644 --- a/test/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml @@ -15,101 +15,89 @@ # Pre-test setup - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-targethttpsproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-targethttpsproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-targethttpsproxy" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-targethttpsproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-targethttpsproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-targethttpsproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a url map gcp_compute_url_map: - name: "urlmap-targethttpsproxy" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: urlmap-targethttpsproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: urlmap - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targethttpsproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: sslcert-targethttpsproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: sslcert - name: delete a target https proxy gcp_compute_target_https_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a target https proxy gcp_compute_target_https_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -133,14 +121,14 @@ # ---------------------------------------------------------------------------- - name: create a target https proxy that already exists gcp_compute_target_https_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -150,14 +138,14 @@ #---------------------------------------------------------- - name: delete a target https proxy gcp_compute_target_https_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -181,14 +169,14 @@ # ---------------------------------------------------------------------------- - name: delete a target https proxy that does not exist gcp_compute_target_https_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -200,82 +188,70 @@ # If errors happen, don't crash the playbook! - name: delete a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targethttpsproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: sslcert-targethttpsproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: sslcert ignore_errors: true - name: delete a url map gcp_compute_url_map: - name: "urlmap-targethttpsproxy" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: urlmap-targethttpsproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: urlmap ignore_errors: true - name: delete a backend service gcp_compute_backend_service: - name: "backendservice-targethttpsproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: backendservice-targethttpsproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: backendservice ignore_errors: true - name: delete a http health check gcp_compute_http_health_check: - name: "httphealthcheck-targethttpsproxy" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: httphealthcheck-targethttpsproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: healthcheck ignore_errors: true - name: delete a instance group gcp_compute_instance_group: - name: "instancegroup-targethttpsproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instancegroup-targethttpsproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instancegroup ignore_errors: true diff --git a/test/integration/targets/gcp_compute_target_pool/tasks/main.yml b/test/integration/targets/gcp_compute_target_pool/tasks/main.yml index e08b6f5585..e829539097 100644 --- a/test/integration/targets/gcp_compute_target_pool/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_pool/tasks/main.yml @@ -15,21 +15,21 @@ # Pre-test setup - name: delete a target pool gcp_compute_target_pool: - name: "{{ resource_name }}" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a target pool gcp_compute_target_pool: - name: "{{ resource_name }}" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -54,12 +54,12 @@ # ---------------------------------------------------------------------------- - name: create a target pool that already exists gcp_compute_target_pool: - name: "{{ resource_name }}" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -69,12 +69,12 @@ #---------------------------------------------------------- - name: delete a target pool gcp_compute_target_pool: - name: "{{ resource_name }}" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -99,12 +99,12 @@ # ---------------------------------------------------------------------------- - name: delete a target pool that does not exist gcp_compute_target_pool: - name: "{{ resource_name }}" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/test/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml b/test/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml index f2b14904a2..915789b169 100644 --- a/test/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml @@ -15,96 +15,84 @@ # Pre-test setup - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-targetsslproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-targetsslproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a health check gcp_compute_health_check: - name: "healthcheck-targetsslproxy" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: healthcheck-targetsslproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-targetsslproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - protocol: SSL - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-targetsslproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: SSL + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targetsslproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: sslcert-targetsslproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: sslcert - name: delete a target ssl proxy gcp_compute_target_ssl_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a target ssl proxy gcp_compute_target_ssl_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -128,14 +116,14 @@ # ---------------------------------------------------------------------------- - name: create a target ssl proxy that already exists gcp_compute_target_ssl_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -145,14 +133,14 @@ #---------------------------------------------------------- - name: delete a target ssl proxy gcp_compute_target_ssl_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -176,14 +164,14 @@ # ---------------------------------------------------------------------------- - name: delete a target ssl proxy that does not exist gcp_compute_target_ssl_proxy: - name: "{{ resource_name }}" - ssl_certificates: - - "{{ sslcert }}" - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -195,76 +183,64 @@ # If errors happen, don't crash the playbook! - name: delete a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targetsslproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: sslcert-targetsslproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: sslcert ignore_errors: true - name: delete a backend service gcp_compute_backend_service: - name: "backendservice-targetsslproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - protocol: SSL - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: backendservice-targetsslproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: SSL + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: backendservice ignore_errors: true - name: delete a health check gcp_compute_health_check: - name: "healthcheck-targetsslproxy" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: healthcheck-targetsslproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: healthcheck ignore_errors: true - name: delete a instance group gcp_compute_instance_group: - name: "instancegroup-targetsslproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instancegroup-targetsslproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instancegroup ignore_errors: true diff --git a/test/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml b/test/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml index e057e090a7..0cfb6a319e 100644 --- a/test/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml @@ -15,61 +15,61 @@ # Pre-test setup - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-targettcpproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-targettcpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a health check gcp_compute_health_check: - name: "healthcheck-targettcpproxy" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: healthcheck-targettcpproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-targettcpproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - protocol: TCP - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-targettcpproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: TCP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: delete a target tcp proxy gcp_compute_target_tcp_proxy: - name: "{{ resource_name }}" - proxy_header: PROXY_V1 - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a target tcp proxy gcp_compute_target_tcp_proxy: - name: "{{ resource_name }}" - proxy_header: PROXY_V1 - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -93,13 +93,13 @@ # ---------------------------------------------------------------------------- - name: create a target tcp proxy that already exists gcp_compute_target_tcp_proxy: - name: "{{ resource_name }}" - proxy_header: PROXY_V1 - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -109,13 +109,13 @@ #---------------------------------------------------------- - name: delete a target tcp proxy gcp_compute_target_tcp_proxy: - name: "{{ resource_name }}" - proxy_header: PROXY_V1 - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -139,13 +139,13 @@ # ---------------------------------------------------------------------------- - name: delete a target tcp proxy that does not exist gcp_compute_target_tcp_proxy: - name: "{{ resource_name }}" - proxy_header: PROXY_V1 - service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -157,42 +157,42 @@ # If errors happen, don't crash the playbook! - name: delete a backend service gcp_compute_backend_service: - name: "backendservice-targettcpproxy" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - protocol: TCP - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: backendservice-targettcpproxy + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: TCP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: backendservice ignore_errors: true - name: delete a health check gcp_compute_health_check: - name: "healthcheck-targettcpproxy" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: healthcheck-targettcpproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: healthcheck ignore_errors: true - name: delete a instance group gcp_compute_instance_group: - name: "instancegroup-targettcpproxy" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instancegroup-targettcpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instancegroup ignore_errors: true diff --git a/test/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml b/test/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml index ed7d69449f..a94f0585e7 100644 --- a/test/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml +++ b/test/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml @@ -15,40 +15,40 @@ # Pre-test setup - name: create a address gcp_compute_address: - name: "address-vpngateway" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: address-vpngateway + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: address - name: create a network gcp_compute_network: - name: "network-vpngateway" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-vpngateway + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: delete a target vpn gateway gcp_compute_target_vpn_gateway: - name: "{{ resource_name }}" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a target vpn gateway gcp_compute_target_vpn_gateway: - name: "{{ resource_name }}" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -73,13 +73,13 @@ # ---------------------------------------------------------------------------- - name: create a target vpn gateway that already exists gcp_compute_target_vpn_gateway: - name: "{{ resource_name }}" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -89,13 +89,13 @@ #---------------------------------------------------------- - name: delete a target vpn gateway gcp_compute_target_vpn_gateway: - name: "{{ resource_name }}" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -120,13 +120,13 @@ # ---------------------------------------------------------------------------- - name: delete a target vpn gateway that does not exist gcp_compute_target_vpn_gateway: - name: "{{ resource_name }}" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -138,20 +138,20 @@ # If errors happen, don't crash the playbook! - name: delete a network gcp_compute_network: - name: "network-vpngateway" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: network-vpngateway + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: network ignore_errors: true - name: delete a address gcp_compute_address: - name: "address-vpngateway" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: address-vpngateway + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: address ignore_errors: true diff --git a/test/integration/targets/gcp_compute_url_map/tasks/main.yml b/test/integration/targets/gcp_compute_url_map/tasks/main.yml index 6e4a16f5fc..5bb2b2ba17 100644 --- a/test/integration/targets/gcp_compute_url_map/tasks/main.yml +++ b/test/integration/targets/gcp_compute_url_map/tasks/main.yml @@ -15,55 +15,55 @@ # Pre-test setup - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-urlmap" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-urlmap + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-urlmap" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-urlmap + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-urlmap" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-urlmap + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: delete a url map gcp_compute_url_map: - name: "{{ resource_name }}" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a url map gcp_compute_url_map: - name: "{{ resource_name }}" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -87,12 +87,12 @@ # ---------------------------------------------------------------------------- - name: create a url map that already exists gcp_compute_url_map: - name: "{{ resource_name }}" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -102,12 +102,12 @@ #---------------------------------------------------------- - name: delete a url map gcp_compute_url_map: - name: "{{ resource_name }}" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -131,12 +131,12 @@ # ---------------------------------------------------------------------------- - name: delete a url map that does not exist gcp_compute_url_map: - name: "{{ resource_name }}" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -148,38 +148,38 @@ # If errors happen, don't crash the playbook! - name: delete a backend service gcp_compute_backend_service: - name: "backendservice-urlmap" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: backendservice-urlmap + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: backendservice ignore_errors: true - name: delete a http health check gcp_compute_http_health_check: - name: "httphealthcheck-urlmap" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: httphealthcheck-urlmap + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: healthcheck ignore_errors: true - name: delete a instance group gcp_compute_instance_group: - name: "instancegroup-urlmap" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instancegroup-urlmap + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instancegroup ignore_errors: true diff --git a/test/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml b/test/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml index 7cdd3de88a..ffa4a266b2 100644 --- a/test/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml +++ b/test/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml @@ -15,63 +15,63 @@ # Pre-test setup - name: create a network gcp_compute_network: - name: "network-vpn-tunnel" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-vpn-tunnel + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: create a router gcp_compute_router: - name: "router-vpn-tunnel" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: router-vpn-tunnel + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: router - name: create a target vpn gateway gcp_compute_target_vpn_gateway: - name: "gateway-vpn-tunnel" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: gateway-vpn-tunnel + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: gateway - name: delete a vpn tunnel gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a vpn tunnel gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -96,15 +96,15 @@ # ---------------------------------------------------------------------------- - name: create a vpn tunnel that already exists gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -114,15 +114,15 @@ #---------------------------------------------------------- - name: delete a vpn tunnel gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -147,15 +147,15 @@ # ---------------------------------------------------------------------------- - name: delete a vpn tunnel that does not exist gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -167,40 +167,40 @@ # If errors happen, don't crash the playbook! - name: delete a target vpn gateway gcp_compute_target_vpn_gateway: - name: "gateway-vpn-tunnel" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: gateway-vpn-tunnel + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: gateway ignore_errors: true - name: delete a router gcp_compute_router: - name: "router-vpn-tunnel" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: router-vpn-tunnel + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: router ignore_errors: true - name: delete a network gcp_compute_network: - name: "network-vpn-tunnel" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: network-vpn-tunnel + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: network ignore_errors: true