forked from mweisel/gcp-gns3server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcp_resources_delete.yml
35 lines (31 loc) · 999 Bytes
/
gcp_resources_delete.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- name: delete gcp resources
hosts: localhost
gather_facts: no
vars_files:
- vars.yml
tasks:
- name: delete firewall rule (wireguard)
gcp_compute_firewall:
name: "{{ gcp_fr_name }}"
project: "{{ gcp_project_id }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file_dir }}/{{ gcp_cred_file }}"
state: absent
- name: delete vm instance
gcp_compute_instance:
name: "{{ gcp_vm_name }}"
zone: "{{ gcp_zone }}"
project: "{{ gcp_project_id }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file_dir }}/{{ gcp_cred_file }}"
state: absent
- name: delete disk
gcp_compute_disk:
name: "{{ gcp_disk_name }}"
zone: "{{ gcp_zone }}"
project: "{{ gcp_project_id }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file_dir }}/{{ gcp_cred_file }}"
state: absent
...