-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove firewall rules before running ocp uninstall
- Loading branch information
Patrick Rutledge
committed
Nov 15, 2023
1 parent
d585f3e
commit f2024ff
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
- name: Find k8s Firewall Rules in GCP | ||
google.cloud.gcp_compute_firewall_info: | ||
auth_kind: "{{ gcp_auth_type }}" | ||
service_account_file: "{{ gcp_credentials_file }}" | ||
project: "{{ gcp_project_id }}" | ||
register: r_firewall_info | ||
|
||
- name: Delete k8s Firewall Rules in GCP | ||
when: | ||
- r_firewall_info.resources | length > 0 | ||
- item.name.startswith('k8s-') | ||
google.cloud.gcp_compute_instance: | ||
auth_kind: "{{ gcp_auth_type }}" | ||
service_account_file: "{{ gcp_credentials_file }}" | ||
project: "{{ gcp_project_id }}" | ||
name: "{{ item.name }}" | ||
state: absent | ||
loop: "{{ r_firewall_info.resources }}" |