mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-06 02:40:29 -07:00
Integration test fixes (#142)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
d16c2b8629
commit
30f3eb02e9
15 changed files with 268 additions and 270 deletions
|
@ -165,8 +165,8 @@ EXAMPLES = '''
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- us-central1-a
|
||||
- us-central1-f
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
|
|
|
@ -124,45 +124,45 @@ 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: create a vpn-tunnel
|
||||
gcp_compute_vpn-tunnel:
|
||||
name: "test_object"
|
||||
region: us-west1
|
||||
target_vpn_gateway: "{{ gateway }}"
|
||||
|
|
|
@ -110,8 +110,6 @@ EXAMPLES = '''
|
|||
gcp_pubsub_subscription:
|
||||
name: "test_object"
|
||||
topic: "{{ topic }}"
|
||||
push_config:
|
||||
push_endpoint: https://myapp.graphite.cloudnativeapp.com/webhook/sub1
|
||||
ack_deadline_seconds: 300
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
|
|
|
@ -75,18 +75,18 @@ extends_documentation_fragment: gcp
|
|||
EXAMPLES = '''
|
||||
- name: create a instance
|
||||
gcp_sql_instance:
|
||||
name: "{{resource_name}}-3"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: "{{ resource_name }}"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: instance
|
||||
|
||||
- name: create a database
|
||||
|
|
|
@ -76,18 +76,18 @@ extends_documentation_fragment: gcp
|
|||
EXAMPLES = '''
|
||||
- name: create a instance
|
||||
gcp_sql_instance:
|
||||
name: "{{resource_name}}-1"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: "{{ resource_name }}"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: instance
|
||||
|
||||
- name: create a user
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- us-central1-a
|
||||
- us-central1-f
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
|
@ -36,8 +36,8 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- us-central1-a
|
||||
- us-central1-f
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
|
@ -72,8 +72,8 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- us-central1-a
|
||||
- us-central1-f
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
|
@ -93,8 +93,8 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- us-central1-a
|
||||
- us-central1-f
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
|
@ -129,8 +129,8 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- us-central1-a
|
||||
- us-central1-f
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
|
|
|
@ -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: 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: 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: 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
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
|
@ -94,17 +94,17 @@
|
|||
that:
|
||||
- results['resources'] | length == 1
|
||||
# ----------------------------------------------------------------------------
|
||||
- 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: 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
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
|
@ -112,17 +112,17 @@
|
|||
- result.changed == false
|
||||
- "result.kind == 'compute#vpnTunnel'"
|
||||
#----------------------------------------------------------
|
||||
- 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: 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
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
|
@ -145,17 +145,17 @@
|
|||
that:
|
||||
- results['resources'] | length == 0
|
||||
# ----------------------------------------------------------------------------
|
||||
- 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: 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
|
||||
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
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length >= 1
|
||||
- "'my-cluster' in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a cluster that already exists
|
||||
gcp_container_cluster:
|
||||
|
@ -116,7 +116,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length == 0
|
||||
- "'my-cluster' not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a cluster that does not exist
|
||||
gcp_container_cluster:
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length >= 1
|
||||
- "'my-pool' in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a node pool that already exists
|
||||
gcp_container_node_pool:
|
||||
|
|
|
@ -23,23 +23,23 @@
|
|||
register: topic
|
||||
- name: delete a subscription
|
||||
gcp_pubsub_subscription:
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a subscription
|
||||
gcp_pubsub_subscription:
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
|
@ -56,17 +56,17 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length >= 1
|
||||
- "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a subscription that already exists
|
||||
gcp_pubsub_subscription:
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
|
@ -75,13 +75,13 @@
|
|||
#----------------------------------------------------------
|
||||
- name: delete a subscription
|
||||
gcp_pubsub_subscription:
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
|
@ -98,17 +98,17 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length == 0
|
||||
- "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a subscription that does not exist
|
||||
gcp_pubsub_subscription:
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
name: "{{ resource_name }}"
|
||||
topic: "{{ topic }}"
|
||||
ack_deadline_seconds: 300
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length >= 1
|
||||
- "'test-topic1' in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a topic that already exists
|
||||
gcp_pubsub_topic:
|
||||
|
@ -82,7 +82,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length == 0
|
||||
- "'test-topic1' not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a topic that does not exist
|
||||
gcp_pubsub_topic:
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length >= 1
|
||||
- "'webstore' in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a database that already exists
|
||||
gcp_spanner_database:
|
||||
|
@ -101,7 +101,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length == 0
|
||||
- "'webstore' not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a database that does not exist
|
||||
gcp_spanner_database:
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length >= 1
|
||||
- "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a instance that already exists
|
||||
gcp_spanner_instance:
|
||||
|
@ -102,7 +102,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length == 0
|
||||
- "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a instance that does not exist
|
||||
gcp_spanner_instance:
|
||||
|
|
|
@ -15,18 +15,18 @@
|
|||
# Pre-test setup
|
||||
- name: create a instance
|
||||
gcp_sql_instance:
|
||||
name: "{{resource_name}}-3"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: "{{ resource_name }}"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: instance
|
||||
- name: delete a database
|
||||
gcp_sql_database:
|
||||
|
@ -132,17 +132,17 @@
|
|||
# If errors happen, don't crash the playbook!
|
||||
- name: delete a instance
|
||||
gcp_sql_instance:
|
||||
name: "{{resource_name}}-3"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
name: "{{ resource_name }}"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
register: instance
|
||||
ignore_errors: true
|
||||
|
|
|
@ -15,18 +15,18 @@
|
|||
# Pre-test setup
|
||||
- name: create a instance
|
||||
gcp_sql_instance:
|
||||
name: "{{resource_name}}-1"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: "{{ resource_name }}"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: instance
|
||||
- name: delete a user
|
||||
gcp_sql_user:
|
||||
|
@ -137,17 +137,17 @@
|
|||
# If errors happen, don't crash the playbook!
|
||||
- name: delete a instance
|
||||
gcp_sql_instance:
|
||||
name: "{{resource_name}}-1"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
name: "{{ resource_name }}"
|
||||
settings:
|
||||
ip_configuration:
|
||||
authorized_networks:
|
||||
- name: google dns server
|
||||
value: 8.8.8.8/32
|
||||
tier: db-n1-standard-1
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: absent
|
||||
register: instance
|
||||
ignore_errors: true
|
||||
|
|
Loading…
Add table
Reference in a new issue