fix: upgrade ansible version, address test and lint errors

This commit is contained in:
Chris Hawk 2023-11-17 16:39:42 -08:00
commit 08ada5354d
216 changed files with 4394 additions and 4262 deletions

View file

@ -13,16 +13,16 @@
#
# ----------------------------------------------------------------------------
# Pre-test setup
- name: create a network
- name: Create a network
google.cloud.gcp_compute_network:
name: network-subnetwork
auto_create_subnetworks: 'true'
auto_create_subnetworks: "true"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"
state: present
register: network
- name: delete a subnetwork
- name: Delete a subnetwork
google.cloud.gcp_compute_subnetwork:
name: ansiblenet
region: us-west1
@ -33,7 +33,7 @@
service_account_file: "{{ gcp_cred_file | default(omit) }}"
state: absent
#----------------------------------------------------------
- name: create a subnetwork
- name: Create a subnetwork
google.cloud.gcp_compute_subnetwork:
name: ansiblenet
region: us-west1
@ -44,27 +44,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 subnetwork was created
- name: Verify that subnetwork was created
google.cloud.gcp_compute_subnetwork_info:
filters:
- name = ansiblenet
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 = ansiblenet
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 subnetwork that already exists
- name: Create a subnetwork that already exists
google.cloud.gcp_compute_subnetwork:
name: ansiblenet
region: us-west1
@ -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 subnetwork
- name: Delete a subnetwork
google.cloud.gcp_compute_subnetwork:
name: ansiblenet
region: us-west1
@ -91,27 +91,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 subnetwork was deleted
- name: Verify that subnetwork was deleted
google.cloud.gcp_compute_subnetwork_info:
filters:
- name = ansiblenet
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 = ansiblenet
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 subnetwork that does not exist
- name: Delete a subnetwork that does not exist
google.cloud.gcp_compute_subnetwork:
name: ansiblenet
region: us-west1
@ -122,17 +122,17 @@
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-subnetwork
auto_create_subnetworks: 'true'
auto_create_subnetworks: "true"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"

View file

@ -1,2 +1,3 @@
---
- include_tasks: autogen.yml
- name: Generated tests
ansible.builtin.include_tasks: autogen.yml