mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-08 11:50:28 -07:00
Example refactor
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
4312d2750d
commit
1c66f366cf
3 changed files with 242 additions and 242 deletions
|
@ -18,7 +18,7 @@
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -34,13 +34,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -67,13 +67,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -97,14 +97,14 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- results['items'] | length == 1
|
- results['resources'] | length == 1
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a ssl certificate that already exists
|
- name: create a ssl certificate that already exists
|
||||||
gcp_compute_ssl_certificate:
|
gcp_compute_ssl_certificate:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -120,13 +120,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -159,13 +159,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -189,14 +189,14 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- results['items'] | length == 0
|
- results['resources'] | length == 0
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a ssl certificate that does not exist
|
- name: delete a ssl certificate that does not exist
|
||||||
gcp_compute_ssl_certificate:
|
gcp_compute_ssl_certificate:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -212,13 +212,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
|
|
@ -15,53 +15,53 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: create a instance group
|
- name: create a instance group
|
||||||
gcp_compute_instance_group:
|
gcp_compute_instance_group:
|
||||||
name: "instancegroup-targethttpsproxy"
|
name: instancegroup-targethttpsproxy
|
||||||
zone: us-central1-a
|
zone: us-central1-a
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: instancegroup
|
register: instancegroup
|
||||||
- name: create a http health check
|
- name: create a http health check
|
||||||
gcp_compute_http_health_check:
|
gcp_compute_http_health_check:
|
||||||
name: "httphealthcheck-targethttpsproxy"
|
name: httphealthcheck-targethttpsproxy
|
||||||
healthy_threshold: 10
|
healthy_threshold: 10
|
||||||
port: 8080
|
port: 8080
|
||||||
timeout_sec: 2
|
timeout_sec: 2
|
||||||
unhealthy_threshold: 5
|
unhealthy_threshold: 5
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: healthcheck
|
register: healthcheck
|
||||||
- name: create a backend service
|
- name: create a backend service
|
||||||
gcp_compute_backend_service:
|
gcp_compute_backend_service:
|
||||||
name: "backendservice-targethttpsproxy"
|
name: backendservice-targethttpsproxy
|
||||||
backends:
|
backends:
|
||||||
- group: "{{ instancegroup }}"
|
- group: "{{ instancegroup }}"
|
||||||
health_checks:
|
health_checks:
|
||||||
- "{{ healthcheck.selfLink }}"
|
- "{{ healthcheck.selfLink }}"
|
||||||
enable_cdn: true
|
enable_cdn: 'true'
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: backendservice
|
register: backendservice
|
||||||
- name: create a url map
|
- name: create a url map
|
||||||
gcp_compute_url_map:
|
gcp_compute_url_map:
|
||||||
name: "urlmap-targethttpsproxy"
|
name: urlmap-targethttpsproxy
|
||||||
default_service: "{{ backendservice }}"
|
default_service: "{{ backendservice }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: urlmap
|
register: urlmap
|
||||||
- name: create a ssl certificate
|
- name: create a ssl certificate
|
||||||
gcp_compute_ssl_certificate:
|
gcp_compute_ssl_certificate:
|
||||||
name: "sslcert-targethttpsproxy"
|
name: "sslcert-targethttpsproxy"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -77,13 +77,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -91,25 +91,25 @@
|
||||||
register: sslcert
|
register: sslcert
|
||||||
- name: delete a target https proxy
|
- name: delete a target https proxy
|
||||||
gcp_compute_target_https_proxy:
|
gcp_compute_target_https_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
url_map: "{{ urlmap }}"
|
url_map: "{{ urlmap }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a target https proxy
|
- name: create a target https proxy
|
||||||
gcp_compute_target_https_proxy:
|
gcp_compute_target_https_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
url_map: "{{ urlmap }}"
|
url_map: "{{ urlmap }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -129,18 +129,18 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- results['items'] | length == 1
|
- results['resources'] | length == 1
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a target https proxy that already exists
|
- name: create a target https proxy that already exists
|
||||||
gcp_compute_target_https_proxy:
|
gcp_compute_target_https_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
url_map: "{{ urlmap }}"
|
url_map: "{{ urlmap }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -150,14 +150,14 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a target https proxy
|
- name: delete a target https proxy
|
||||||
gcp_compute_target_https_proxy:
|
gcp_compute_target_https_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
url_map: "{{ urlmap }}"
|
url_map: "{{ urlmap }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -177,18 +177,18 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- results['items'] | length == 0
|
- results['resources'] | length == 0
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a target https proxy that does not exist
|
- name: delete a target https proxy that does not exist
|
||||||
gcp_compute_target_https_proxy:
|
gcp_compute_target_https_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
url_map: "{{ urlmap }}"
|
url_map: "{{ urlmap }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
name: "sslcert-targethttpsproxy"
|
name: "sslcert-targethttpsproxy"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -219,13 +219,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -234,48 +234,48 @@
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: delete a url map
|
- name: delete a url map
|
||||||
gcp_compute_url_map:
|
gcp_compute_url_map:
|
||||||
name: "urlmap-targethttpsproxy"
|
name: urlmap-targethttpsproxy
|
||||||
default_service: "{{ backendservice }}"
|
default_service: "{{ backendservice }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: urlmap
|
register: urlmap
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: delete a backend service
|
- name: delete a backend service
|
||||||
gcp_compute_backend_service:
|
gcp_compute_backend_service:
|
||||||
name: "backendservice-targethttpsproxy"
|
name: backendservice-targethttpsproxy
|
||||||
backends:
|
backends:
|
||||||
- group: "{{ instancegroup }}"
|
- group: "{{ instancegroup }}"
|
||||||
health_checks:
|
health_checks:
|
||||||
- "{{ healthcheck.selfLink }}"
|
- "{{ healthcheck.selfLink }}"
|
||||||
enable_cdn: true
|
enable_cdn: 'true'
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: backendservice
|
register: backendservice
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: delete a http health check
|
- name: delete a http health check
|
||||||
gcp_compute_http_health_check:
|
gcp_compute_http_health_check:
|
||||||
name: "httphealthcheck-targethttpsproxy"
|
name: httphealthcheck-targethttpsproxy
|
||||||
healthy_threshold: 10
|
healthy_threshold: 10
|
||||||
port: 8080
|
port: 8080
|
||||||
timeout_sec: 2
|
timeout_sec: 2
|
||||||
unhealthy_threshold: 5
|
unhealthy_threshold: 5
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: healthcheck
|
register: healthcheck
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: delete a instance group
|
- name: delete a instance group
|
||||||
gcp_compute_instance_group:
|
gcp_compute_instance_group:
|
||||||
name: "instancegroup-targethttpsproxy"
|
name: instancegroup-targethttpsproxy
|
||||||
zone: us-central1-a
|
zone: us-central1-a
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: instancegroup
|
register: instancegroup
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -15,48 +15,48 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: create a instance group
|
- name: create a instance group
|
||||||
gcp_compute_instance_group:
|
gcp_compute_instance_group:
|
||||||
name: "instancegroup-targetsslproxy"
|
name: instancegroup-targetsslproxy
|
||||||
zone: us-central1-a
|
zone: us-central1-a
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: instancegroup
|
register: instancegroup
|
||||||
- name: create a health check
|
- name: create a health check
|
||||||
gcp_compute_health_check:
|
gcp_compute_health_check:
|
||||||
name: "healthcheck-targetsslproxy"
|
name: healthcheck-targetsslproxy
|
||||||
type: TCP
|
type: TCP
|
||||||
tcp_health_check:
|
tcp_health_check:
|
||||||
port_name: service-health
|
port_name: service-health
|
||||||
request: ping
|
request: ping
|
||||||
response: pong
|
response: pong
|
||||||
healthy_threshold: 10
|
healthy_threshold: 10
|
||||||
timeout_sec: 2
|
timeout_sec: 2
|
||||||
unhealthy_threshold: 5
|
unhealthy_threshold: 5
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: healthcheck
|
register: healthcheck
|
||||||
- name: create a backend service
|
- name: create a backend service
|
||||||
gcp_compute_backend_service:
|
gcp_compute_backend_service:
|
||||||
name: "backendservice-targetsslproxy"
|
name: backendservice-targetsslproxy
|
||||||
backends:
|
backends:
|
||||||
- group: "{{ instancegroup }}"
|
- group: "{{ instancegroup }}"
|
||||||
health_checks:
|
health_checks:
|
||||||
- "{{ healthcheck.selfLink }}"
|
- "{{ healthcheck.selfLink }}"
|
||||||
protocol: SSL
|
protocol: SSL
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: backendservice
|
register: backendservice
|
||||||
- name: create a ssl certificate
|
- name: create a ssl certificate
|
||||||
gcp_compute_ssl_certificate:
|
gcp_compute_ssl_certificate:
|
||||||
name: "sslcert-targetsslproxy"
|
name: "sslcert-targetsslproxy"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -72,13 +72,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -86,25 +86,25 @@
|
||||||
register: sslcert
|
register: sslcert
|
||||||
- name: delete a target ssl proxy
|
- name: delete a target ssl proxy
|
||||||
gcp_compute_target_ssl_proxy:
|
gcp_compute_target_ssl_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
service: "{{ backendservice }}"
|
service: "{{ backendservice }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a target ssl proxy
|
- name: create a target ssl proxy
|
||||||
gcp_compute_target_ssl_proxy:
|
gcp_compute_target_ssl_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
service: "{{ backendservice }}"
|
service: "{{ backendservice }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -124,18 +124,18 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- results['items'] | length == 1
|
- results['resources'] | length == 1
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a target ssl proxy that already exists
|
- name: create a target ssl proxy that already exists
|
||||||
gcp_compute_target_ssl_proxy:
|
gcp_compute_target_ssl_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
service: "{{ backendservice }}"
|
service: "{{ backendservice }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -145,14 +145,14 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a target ssl proxy
|
- name: delete a target ssl proxy
|
||||||
gcp_compute_target_ssl_proxy:
|
gcp_compute_target_ssl_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
service: "{{ backendservice }}"
|
service: "{{ backendservice }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
assert:
|
assert:
|
||||||
|
@ -172,18 +172,18 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- results['items'] | length == 0
|
- results['resources'] | length == 0
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a target ssl proxy that does not exist
|
- name: delete a target ssl proxy that does not exist
|
||||||
gcp_compute_target_ssl_proxy:
|
gcp_compute_target_ssl_proxy:
|
||||||
name: "{{ resource_name }}"
|
name: "{{ resource_name }}"
|
||||||
ssl_certificates:
|
ssl_certificates:
|
||||||
- "{{ sslcert }}"
|
- "{{ sslcert }}"
|
||||||
service: "{{ backendservice }}"
|
service: "{{ backendservice }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
assert:
|
assert:
|
||||||
|
@ -198,7 +198,7 @@
|
||||||
name: "sslcert-targetsslproxy"
|
name: "sslcert-targetsslproxy"
|
||||||
description: A certificate for testing. Do not use this certificate in production
|
description: A certificate for testing. Do not use this certificate in production
|
||||||
certificate: |
|
certificate: |
|
||||||
-----BEGIN CERTIFICATE-----
|
--BEGIN CERTIFICATE--
|
||||||
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
|
||||||
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
|
||||||
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
|
||||||
|
@ -214,13 +214,13 @@
|
||||||
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
|
||||||
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
|
||||||
zqGNhIPGq2ULqXKK8BY=
|
zqGNhIPGq2ULqXKK8BY=
|
||||||
-----END CERTIFICATE-----
|
--END CERTIFICATE--
|
||||||
private_key: |
|
private_key: |
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
--BEGIN EC PRIVATE KEY--
|
||||||
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49
|
||||||
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f
|
||||||
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ==
|
||||||
-----END EC PRIVATE KEY-----
|
--END EC PRIVATE KEY--
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -229,42 +229,42 @@
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: delete a backend service
|
- name: delete a backend service
|
||||||
gcp_compute_backend_service:
|
gcp_compute_backend_service:
|
||||||
name: "backendservice-targetsslproxy"
|
name: backendservice-targetsslproxy
|
||||||
backends:
|
backends:
|
||||||
- group: "{{ instancegroup }}"
|
- group: "{{ instancegroup }}"
|
||||||
health_checks:
|
health_checks:
|
||||||
- "{{ healthcheck.selfLink }}"
|
- "{{ healthcheck.selfLink }}"
|
||||||
protocol: SSL
|
protocol: SSL
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: backendservice
|
register: backendservice
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: delete a health check
|
- name: delete a health check
|
||||||
gcp_compute_health_check:
|
gcp_compute_health_check:
|
||||||
name: "healthcheck-targetsslproxy"
|
name: healthcheck-targetsslproxy
|
||||||
type: TCP
|
type: TCP
|
||||||
tcp_health_check:
|
tcp_health_check:
|
||||||
port_name: service-health
|
port_name: service-health
|
||||||
request: ping
|
request: ping
|
||||||
response: pong
|
response: pong
|
||||||
healthy_threshold: 10
|
healthy_threshold: 10
|
||||||
timeout_sec: 2
|
timeout_sec: 2
|
||||||
unhealthy_threshold: 5
|
unhealthy_threshold: 5
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: healthcheck
|
register: healthcheck
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: delete a instance group
|
- name: delete a instance group
|
||||||
gcp_compute_instance_group:
|
gcp_compute_instance_group:
|
||||||
name: "instancegroup-targetsslproxy"
|
name: instancegroup-targetsslproxy
|
||||||
zone: us-central1-a
|
zone: us-central1-a
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: instancegroup
|
register: instancegroup
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
Loading…
Add table
Reference in a new issue