Skip to content

Instantly share code, notes, and snippets.

@garystafford garystafford/delete.yml
Last active Jan 30, 2019

Embed
What would you like to do?
---
- name: delete an instance
gcp_compute_instance:
name: "{{ instance_name }}"
zone: "{{ zone }}"
project: "{{ lookup('env','GCP_PROJECT') }}"
state: absent
- name: delete an address
gcp_compute_address:
name: "{{ instance_name }}"
region: "{{ region }}"
project: "{{ lookup('env','GCP_PROJECT') }}"
state: absent
- name: delete a firewall
gcp_compute_firewall:
name: ansible-firewall
project: "{{ lookup('env','GCP_PROJECT') }}"
state: absent
- name: register the existing network
gcp_compute_network:
name: ansible-network
project: "{{ lookup('env','GCP_PROJECT') }}"
register: network
# - debug:
# var: network
- name: delete a subnetwork
gcp_compute_subnetwork:
name: ansible-subnet
region: "{{ region }}"
network: "{{ network }}"
ip_cidr_range: "{{ ip_cidr_range }}"
project: "{{ lookup('env','GCP_PROJECT') }}"
state: absent
- name: delete a network
gcp_compute_network:
name: ansible-network
project: "{{ lookup('env','GCP_PROJECT') }}"
state: absent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.