Bug fixes for GCP modules (as of 2019-01-09T15:35:45-08:00) (#50785)

This commit is contained in:
Alex Stephen
2019-01-16 11:15:03 -08:00
committed by ansibot
parent eca7c3c8c7
commit 5ca5936e05
32 changed files with 282 additions and 188 deletions

View File

@@ -25,7 +25,7 @@
register: cluster
- name: delete a node pool
gcp_container_node_pool:
name: "{{ resource_name }}"
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
zone: us-central1-a
@@ -36,7 +36,7 @@
#----------------------------------------------------------
- name: create a node pool
gcp_container_node_pool:
name: "{{ resource_name }}"
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
zone: us-central1-a
@@ -51,8 +51,6 @@
- result.changed == true
- name: verify that node_pool was created
gcp_container_node_pool_facts:
filters:
- name = {{ resource_name }}
cluster: "{{ cluster }}"
zone: us-central1-a
project: "{{ gcp_project }}"
@@ -64,11 +62,11 @@
- 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:
name: "{{ resource_name }}"
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
zone: us-central1-a
@@ -84,7 +82,7 @@
#----------------------------------------------------------
- name: delete a node pool
gcp_container_node_pool:
name: "{{ resource_name }}"
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
zone: us-central1-a
@@ -99,8 +97,6 @@
- result.changed == true
- name: verify that node_pool was deleted
gcp_container_node_pool_facts:
filters:
- name = {{ resource_name }}
cluster: "{{ cluster }}"
zone: us-central1-a
project: "{{ gcp_project }}"
@@ -112,11 +108,11 @@
- name: verify that command succeeded
assert:
that:
- results['items'] | length == 0
- "'my-pool' not in \"{{ results['items'] | map(attribute='name') | list }}\""
# ----------------------------------------------------------------------------
- name: delete a node pool that does not exist
gcp_container_node_pool:
name: "{{ resource_name }}"
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
zone: us-central1-a
@@ -131,6 +127,7 @@
- result.changed == false
#---------------------------------------------------------
# Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a cluster
gcp_container_cluster:
name: "cluster-nodepool"
@@ -141,3 +138,4 @@
service_account_file: "{{ gcp_cred_file }}"
state: absent
register: cluster
ignore_errors: true