Skip to content

Commit

Permalink
Fix region and zone in ppc64le destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Stringy committed Jan 3, 2024
1 parent b8b1b67 commit dc521ae
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions ansible/roles/destroy-vm/tasks/destroy-ppc64le-vm.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
---

#Set fact that are required to destroy vsi instance
# Set fact that are required to destroy vsi instance
- set_fact:
region: "{{ lookup('env', 'IC_REGION') }}"
zone: "{{ lookup('env', 'IC_ZONE') }}"
pi_cloud_instance_id: "51a46537-a3a3-4e79-88ee-507feb47e7d0"
hostname: "{{ inventory_hostname }}"

- name: Get instance id by name
delegate_to: localhost
ibm.cloudcollection.ibm_pi_instance_info:
region: "{{ region }}"
zone: "{{ zone }}"
pi_instance_name: "{{ hostname }}"
pi_cloud_instance_id: "{{ pi_cloud_instance_id }}"
failed_when:
Expand All @@ -37,8 +32,6 @@
- name: Delete instance by id
delegate_to: localhost
ibm.cloudcollection.ibm_pi_instance:
region: "{{ region }}"
zone: "{{ zone }}"
state: absent
pi_cloud_instance_id: "{{ pi_cloud_instance_id }}"
id: "{{ pi_instance.id }}"
Expand All @@ -52,8 +45,6 @@
- name: Check for existing network
delegate_to: localhost
ibm.cloudcollection.ibm_pi_network_info:
region: "{{ region }}"
zone: "{{ zone }}"
pi_network_name: "{{ hostname }}-network"
pi_cloud_instance_id: "{{ pi_cloud_instance_id }}"
failed_when:
Expand All @@ -71,8 +62,6 @@
- name: Delete network
delegate_to: localhost
ibm.cloudcollection.ibm_pi_network:
region: "{{ region }}"
zone: "{{ zone }}"
pi_cloud_instance_id: "{{ pi_cloud_instance_id }}"
state: absent
id: "{{ pi_network_id }}"
Expand All @@ -83,8 +72,6 @@
- name: Check for existing SSH Key
delegate_to: localhost
ibm.cloudcollection.ibm_pi_key_info:
region: "{{ region }}"
zone: "{{ zone }}"
pi_key_name: "{{ hostname }}-ssh-key"
pi_cloud_instance_id: "{{ pi_cloud_instance_id }}"
failed_when:
Expand All @@ -102,8 +89,6 @@
- name: Delete SSH Key
delegate_to: localhost
ibm.cloudcollection.ibm_pi_key:
region: "{{ region }}"
zone: "{{ zone }}"
pi_cloud_instance_id: "{{ pi_cloud_instance_id }}"
state: absent
pi_ssh_key: "{{ pi_ssh_key_existing_output.resource }}"
Expand Down

0 comments on commit dc521ae

Please sign in to comment.