Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibm_is_instance: Unable to delete cloud instance #74

Open
CastawayEGR opened this issue Oct 10, 2021 · 1 comment
Open

ibm_is_instance: Unable to delete cloud instance #74

CastawayEGR opened this issue Oct 10, 2021 · 1 comment

Comments

@CastawayEGR
Copy link

CastawayEGR commented Oct 10, 2021

Unable to delete IBM Cloud instance using ibm_is_instance module. I've tried adding keys as in the example, removing, as well as populating almost all parameters with information to no avail.

Ansible version: 2.9.7
IBM collection version: 1.33.1

Steps to replicate:

  1. Get a IBM Cloud instance ID from the machine to delete.

Screen Shot 2021-10-10 at 11 40 32 AM

  1. Run playbook with with state: absent to delete using instance id from step 1.
- name: Delete IBM Cloud Instance
  ibm.cloudcollection.ibm_is_instance:
    state: absent
    id: "0737_574e7203-8ccf-468c-ae9e-a97ba6f1b8cb"
    keys: []
- meta: end_play

Standard Error Output:

Error: Missing required argument

  on ibm_is_instance_ansible_20211010-153629.tf line 1, in resource "ibm_is_instance" "ansible_20211010-153629":
   1: resource ibm_is_instance "ansible_20211010-153629" {

"instance_template": one of `boot_volume.0.snapshot,image,instance_template`
must be specified


Error: Missing required argument

  on ibm_is_instance_ansible_20211010-153629.tf line 1, in resource "ibm_is_instance" "ansible_20211010-153629":
   1: resource ibm_is_instance "ansible_20211010-153629" {

"image": one of `boot_volume.0.snapshot,image,instance_template` must be
specified
@CastawayEGR CastawayEGR changed the title Unable to delete cloud instance using ibm_is_instance. ibm_is_instance: Unable to delete cloud instance Oct 10, 2021
@bpankowski
Copy link

bpankowski commented Jan 11, 2022

Don't look at the examples,

- name: remove VSI
  collections:
   - ibm.cloudcollection
  ibm_is_instance:
    state: absent
    name: "{{ delete_vsi_id.results[item].resource.name }}"
    id: "{{ delete_vsi_id.results[item].resource.id }}"
    image: "{{ delete_vsi_id.results[item].resource.image }}"
    vpc: "{{ delete_vsi_id.results[item].resource.vpc }}"
    zone: "{{ delete_vsi_id.results[item].resource.zone }}"
    profile: "{{ delete_vsi_id.results[item].resource.profile }}"
    primary_network_interface:
      - name: "{{ delete_vsi_id.results[item].resource.primary_network_interface[0].name }}"
        subnet: "{{ delete_vsi_id.results[item].resource.primary_network_interface[0].subnet }}"
    keys: "{{ delete_vsi_id.results[item].resource.keys }}"
    ibmcloud_api_key: "{{ ibm_api_key }}"

That will works and I am not happy about that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants