IBM-Cloud / ansible-collection-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
70 stars 73 forks source link

Unnecessary Parameters required on the module deleting a VSI #52

Open oaomer opened 3 years ago

oaomer commented 3 years ago

This is more of a request for enhancing the capability rather than an issue with it. IBM CloudCollection version 1.23.0 Terraform provider version 1.23.0

When attempting to delete an existing VSI, I was thinking the following task structure should do the job:

As only the service id and instance id that need to be required for deleting a VSI. That failed indicating that the ssh key pair used for creating as well as the processors and memory assigned to the VSI need to be passed to the module and the task should be structured in the example below for the VSI to successfully be deleted. Not sure why these are required. Even passing values for them that do not match what the VSI is assigned the delete worked fine. So, they are not actually required but if they are not passed to the module, the module fails. My request is to modify the module requirement and not make these 3 parameters required when the desired state of the module is 'absent'.

        - name: Destroy a POWER Virtual Server Instance
           ibm_pi_instance:
                state: absent
                id: "{{ pi_cloud_instance_id }}/{{ pi_instance.id }}"
                pi_key_pair_name: "{{ pi_ssh_key.pi_key_name }}"
                pi_processors: "{{ processors }}"
                pi_memory: "{{ memory }}"
           when: pi_instance_existing_output.rc == 0
cunlifs commented 3 years ago

Agree with Osman these parameters are not needed. They can be incorrect values however to allow the delete to work, for example pi_memory = 0 amd pi_key_pair_name = garbage.