google.cloud/tests/integration/targets/gcp_compute_instance/tasks/main.yml
Jorge Gallegos a65d6ebfa5
Rework gcp_compute_instance integration tests
Also adding the test cases for new attachDisk feature
2025-09-10 11:28:16 -07:00

42 lines
1.3 KiB
YAML

---
- name: Generated tests
ansible.builtin.include_tasks: autogen.yml
- name: Extra non-autogen tests
block:
- name: Create network
google.cloud.gcp_compute_network:
name: "{{ resource_prefix }}"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"
auto_create_subnetworks: true
state: present
register: _network
- name: Test GVNIC test cases
ansible.builtin.include_tasks: gvnic.yml
loop: "{{ testcases | dict2items }}"
vars:
gcp_disk_image: projects/centos-cloud/global/images/family/centos-stream-9
gcp_zone: us-central1-a
testcases:
gvnic: GVNIC
virtio: VIRTIO_NET
default: default
- name: Test attach disks
ansible.builtin.include_tasks: attach-disks.yml
vars:
gcp_disk_image: projects/centos-cloud/global/images/family/centos-stream-9
gcp_zone: us-central1-a
always:
- name: Delete network
google.cloud.gcp_compute_network:
name: "{{ resource_prefix }}"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"
auto_create_subnetworks: true
state: absent