mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-28 07:31: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 address
|
||||
- name: Create a address
|
||||
google.cloud.gcp_compute_address:
|
||||
name: address-vpngateway
|
||||
region: us-west1
|
||||
|
@ -22,7 +22,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: address
|
||||
- name: create a network
|
||||
- name: Create a network
|
||||
google.cloud.gcp_compute_network:
|
||||
name: network-vpngateway
|
||||
project: "{{ gcp_project }}"
|
||||
|
@ -31,7 +31,7 @@
|
|||
auto_create_subnetworks: true
|
||||
state: present
|
||||
register: network
|
||||
- name: delete a target vpn gateway
|
||||
- name: Delete a target vpn gateway
|
||||
google.cloud.gcp_compute_target_vpn_gateway:
|
||||
name: "{{ resource_name }}"
|
||||
region: us-west1
|
||||
|
@ -41,7 +41,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a target vpn gateway
|
||||
- name: Create a target vpn gateway
|
||||
google.cloud.gcp_compute_target_vpn_gateway:
|
||||
name: "{{ resource_name }}"
|
||||
region: us-west1
|
||||
|
@ -51,27 +51,27 @@
|
|||
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_vpn_gateway was created
|
||||
- name: Verify that target_vpn_gateway was created
|
||||
google.cloud.gcp_compute_target_vpn_gateway_info:
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
region: us-west1
|
||||
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 }}
|
||||
region: us-west1
|
||||
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 vpn gateway that already exists
|
||||
- name: Create a target vpn gateway that already exists
|
||||
google.cloud.gcp_compute_target_vpn_gateway:
|
||||
name: "{{ resource_name }}"
|
||||
region: us-west1
|
||||
|
@ -81,12 +81,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 vpn gateway
|
||||
- name: Delete a target vpn gateway
|
||||
google.cloud.gcp_compute_target_vpn_gateway:
|
||||
name: "{{ resource_name }}"
|
||||
region: us-west1
|
||||
|
@ -96,27 +96,27 @@
|
|||
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_vpn_gateway was deleted
|
||||
- name: Verify that target_vpn_gateway was deleted
|
||||
google.cloud.gcp_compute_target_vpn_gateway_info:
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
region: us-west1
|
||||
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 }}
|
||||
region: us-west1
|
||||
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 vpn gateway that does not exist
|
||||
- name: Delete a target vpn gateway that does not exist
|
||||
google.cloud.gcp_compute_target_vpn_gateway:
|
||||
name: "{{ resource_name }}"
|
||||
region: us-west1
|
||||
|
@ -126,14 +126,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 network
|
||||
- name: Delete a network
|
||||
google.cloud.gcp_compute_network:
|
||||
name: network-vpngateway
|
||||
project: "{{ gcp_project }}"
|
||||
|
@ -143,7 +143,7 @@
|
|||
state: absent
|
||||
register: network
|
||||
ignore_errors: true
|
||||
- name: delete a address
|
||||
- name: Delete a address
|
||||
google.cloud.gcp_compute_address:
|
||||
name: address-vpngateway
|
||||
region: us-west1
|
||||
|
|
|
@ -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