mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-28 23:51:32 -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: delete a region disk
|
||||
- name: Delete a region disk
|
||||
google.cloud.gcp_compute_region_disk:
|
||||
name: "{{ resource_name }}"
|
||||
size_gb: 500
|
||||
|
@ -21,14 +21,14 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a region disk
|
||||
- name: Create a region disk
|
||||
google.cloud.gcp_compute_region_disk:
|
||||
name: "{{ resource_name }}"
|
||||
size_gb: 500
|
||||
|
@ -36,34 +36,34 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
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 region_disk was created
|
||||
- name: Verify that region_disk was created
|
||||
google.cloud.gcp_compute_region_disk_info:
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
region: us-central1
|
||||
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-central1
|
||||
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 region disk that already exists
|
||||
- name: Create a region disk that already exists
|
||||
google.cloud.gcp_compute_region_disk:
|
||||
name: "{{ resource_name }}"
|
||||
size_gb: 500
|
||||
|
@ -71,19 +71,19 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
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 region disk
|
||||
- name: Delete a region disk
|
||||
google.cloud.gcp_compute_region_disk:
|
||||
name: "{{ resource_name }}"
|
||||
size_gb: 500
|
||||
|
@ -91,34 +91,34 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
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 region_disk was deleted
|
||||
- name: Verify that region_disk was deleted
|
||||
google.cloud.gcp_compute_region_disk_info:
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
region: us-central1
|
||||
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-central1
|
||||
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 region disk that does not exist
|
||||
- name: Delete a region disk that does not exist
|
||||
google.cloud.gcp_compute_region_disk:
|
||||
name: "{{ resource_name }}"
|
||||
size_gb: 500
|
||||
|
@ -126,14 +126,14 @@
|
|||
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
|
||||
region: us-central1
|
||||
replica_zones:
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-a
|
||||
- https://www.googleapis.com/compute/v1/projects/{{ gcp_project }}/zones/us-central1-b
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
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
|
||||
|
|
|
@ -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