mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-29 08:01:31 -07:00
fix: upgrade ansible version, address test and lint errors
This commit is contained in:
parent
c15b47250d
commit
08ada5354d
216 changed files with 4394 additions and 4262 deletions
|
@ -13,7 +13,7 @@
|
|||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# Pre-test setup
|
||||
- name: create a cluster
|
||||
- name: Create a cluster
|
||||
google.cloud.gcp_container_cluster:
|
||||
name: cluster-nodepool
|
||||
initial_node_count: 4
|
||||
|
@ -23,7 +23,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: cluster
|
||||
- name: delete a node pool
|
||||
- name: Delete a node pool
|
||||
google.cloud.gcp_container_node_pool:
|
||||
name: my-pool
|
||||
initial_node_count: 4
|
||||
|
@ -34,7 +34,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a node pool
|
||||
- name: Create a node pool
|
||||
google.cloud.gcp_container_node_pool:
|
||||
name: my-pool
|
||||
initial_node_count: 4
|
||||
|
@ -45,26 +45,26 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
- name: Assert changed is true
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
- name: verify that node_pool was created
|
||||
- name: Verify that node_pool was created
|
||||
google.cloud.gcp_container_node_pool_info:
|
||||
cluster: "{{ cluster }}"
|
||||
location: us-central1-a
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloud-platform
|
||||
cluster: "{{ cluster }}"
|
||||
location: us-central1-a
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloud-platform
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
- name: Verify that command succeeded
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "'my-pool' in \"{{ results['resources'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a node pool that already exists
|
||||
- name: Create a node pool that already exists
|
||||
google.cloud.gcp_container_node_pool:
|
||||
name: my-pool
|
||||
initial_node_count: 4
|
||||
|
@ -75,12 +75,12 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
- name: Assert changed is false
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == false
|
||||
#----------------------------------------------------------
|
||||
- name: delete a node pool
|
||||
- name: Delete a node pool
|
||||
google.cloud.gcp_container_node_pool:
|
||||
name: my-pool
|
||||
initial_node_count: 4
|
||||
|
@ -91,26 +91,26 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
- name: Assert changed is true
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
- name: verify that node_pool was deleted
|
||||
- name: Verify that node_pool was deleted
|
||||
google.cloud.gcp_container_node_pool_info:
|
||||
cluster: "{{ cluster }}"
|
||||
location: us-central1-a
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloud-platform
|
||||
cluster: "{{ cluster }}"
|
||||
location: us-central1-a
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloud-platform
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
- name: Verify that command succeeded
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "'my-pool' not in \"{{ results['resources'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a node pool that does not exist
|
||||
- name: Delete a node pool that does not exist
|
||||
google.cloud.gcp_container_node_pool:
|
||||
name: my-pool
|
||||
initial_node_count: 4
|
||||
|
@ -121,14 +121,14 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
- name: Assert changed is false
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == false
|
||||
#---------------------------------------------------------
|
||||
# Post-test teardown
|
||||
# If errors happen, don't crash the playbook!
|
||||
- name: delete a cluster
|
||||
- name: Delete a cluster
|
||||
google.cloud.gcp_container_cluster:
|
||||
name: cluster-nodepool
|
||||
initial_node_count: 4
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
---
|
||||
- include_tasks: autogen.yml
|
||||
- name: Generated tests
|
||||
ansible.builtin.include_tasks: autogen.yml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue