mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-10-16 05:14:16 -07:00
1. creates instances with a custom ssh keypair 2. change the connection plugin method and perform basic checks 3. cleanup
34 lines
1,003 B
YAML
34 lines
1,003 B
YAML
---
|
|
- name: Teardown test suite
|
|
hosts: localhost
|
|
connection: local
|
|
gather_facts: false
|
|
vars_files:
|
|
- ../vars.yml
|
|
environment:
|
|
GCP_SERVICE_ACCOUNT_FILE: "{{ gcp_cred_file }}"
|
|
GCP_AUTH_KIND: "{{ gcp_cred_kind }}"
|
|
GCP_PROJECT: "{{ gcp_project }}"
|
|
tasks:
|
|
- name: TEARDOWN | Destroy instances # noqa: ignore-errors
|
|
google.cloud.gcp_compute_instance:
|
|
name: "{{ prefix }}-{{ item.name }}"
|
|
machine_type: "{{ gcp_machine_type }}"
|
|
zone: "{{ gcp_zone }}"
|
|
state: absent
|
|
loop: "{{ sut }}"
|
|
ignore_errors: true
|
|
|
|
- name: TEARDOWN | Remove IAP firewall rule # noqa: ignore-errors
|
|
google.cloud.gcp_compute_firewall:
|
|
name: all-iap
|
|
state: absent
|
|
network:
|
|
selfLink: "networks/{{ prefix }}"
|
|
ignore_errors: true
|
|
|
|
- name: TEARDOWN | Destroy network # noqa: ignore-errors
|
|
google.cloud.gcp_compute_network:
|
|
name: "{{ prefix }}"
|
|
state: absent
|
|
ignore_errors: true
|