mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-25 22:30:29 -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 instance group
|
||||
- name: Create a instance group
|
||||
google.cloud.gcp_compute_instance_group:
|
||||
name: instancegroup-targettcpproxy
|
||||
zone: us-central1-a
|
||||
|
@ -22,7 +22,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: instancegroup
|
||||
- name: create a health check
|
||||
- name: Create a health check
|
||||
google.cloud.gcp_compute_health_check:
|
||||
name: healthcheck-targettcpproxy
|
||||
type: TCP
|
||||
|
@ -38,20 +38,20 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: healthcheck
|
||||
- name: create a backend service
|
||||
- name: Create a backend service
|
||||
google.cloud.gcp_compute_backend_service:
|
||||
name: backendservice-targettcpproxy
|
||||
backends:
|
||||
- group: "{{ instancegroup.selfLink }}"
|
||||
- group: "{{ instancegroup.selfLink }}"
|
||||
health_checks:
|
||||
- "{{ healthcheck.selfLink }}"
|
||||
- "{{ healthcheck.selfLink }}"
|
||||
protocol: TCP
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: backendservice
|
||||
- name: delete a target TCP proxy
|
||||
- name: Delete a target TCP proxy
|
||||
google.cloud.gcp_compute_target_tcp_proxy:
|
||||
name: "{{ resource_name }}"
|
||||
proxy_header: PROXY_V1
|
||||
|
@ -61,7 +61,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a target TCP proxy
|
||||
- name: Create a target TCP proxy
|
||||
google.cloud.gcp_compute_target_tcp_proxy:
|
||||
name: "{{ resource_name }}"
|
||||
proxy_header: PROXY_V1
|
||||
|
@ -71,26 +71,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 target_tcp_proxy was created
|
||||
- name: Verify that target_tcp_proxy was created
|
||||
google.cloud.gcp_compute_target_tcp_proxy_info:
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/compute
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/compute
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
- name: Verify that command succeeded
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- results['resources'] | length == 1
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a target TCP proxy that already exists
|
||||
- name: Create a target TCP proxy that already exists
|
||||
google.cloud.gcp_compute_target_tcp_proxy:
|
||||
name: "{{ resource_name }}"
|
||||
proxy_header: PROXY_V1
|
||||
|
@ -100,12 +100,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 target TCP proxy
|
||||
- name: Delete a target TCP proxy
|
||||
google.cloud.gcp_compute_target_tcp_proxy:
|
||||
name: "{{ resource_name }}"
|
||||
proxy_header: PROXY_V1
|
||||
|
@ -115,26 +115,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 target_tcp_proxy was deleted
|
||||
- name: Verify that target_tcp_proxy was deleted
|
||||
google.cloud.gcp_compute_target_tcp_proxy_info:
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/compute
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/compute
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
- name: Verify that command succeeded
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- results['resources'] | length == 0
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a target TCP proxy that does not exist
|
||||
- name: Delete a target TCP proxy that does not exist
|
||||
google.cloud.gcp_compute_target_tcp_proxy:
|
||||
name: "{{ resource_name }}"
|
||||
proxy_header: PROXY_V1
|
||||
|
@ -144,20 +144,20 @@
|
|||
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 backend service
|
||||
- name: Delete a backend service
|
||||
google.cloud.gcp_compute_backend_service:
|
||||
name: backendservice-targettcpproxy
|
||||
backends:
|
||||
- group: "{{ instancegroup.selfLink }}"
|
||||
- group: "{{ instancegroup.selfLink }}"
|
||||
health_checks:
|
||||
- "{{ healthcheck.selfLink }}"
|
||||
- "{{ healthcheck.selfLink }}"
|
||||
protocol: TCP
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
|
@ -165,7 +165,7 @@
|
|||
state: absent
|
||||
register: backendservice
|
||||
ignore_errors: true
|
||||
- name: delete a health check
|
||||
- name: Delete a health check
|
||||
google.cloud.gcp_compute_health_check:
|
||||
name: healthcheck-targettcpproxy
|
||||
type: TCP
|
||||
|
@ -182,7 +182,7 @@
|
|||
state: absent
|
||||
register: healthcheck
|
||||
ignore_errors: true
|
||||
- name: delete a instance group
|
||||
- name: Delete a instance group
|
||||
google.cloud.gcp_compute_instance_group:
|
||||
name: instancegroup-targettcpproxy
|
||||
zone: us-central1-a
|
||||
|
|
|
@ -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