Ansible for openstack

Hi All,
I have provisoned one instance with following order in openstack using Ansible:

  1. Download cloud image
  2. upload cloud image in Openstack
  3. created key pair
  4. created network
  5. created subnet
  6. created router
  7. created security group
  8. created SG rule
  9. created instance

and it went successfully. Now i want to remove the resources what order i should follow:
I tried 1 task and it is success

  1. delete SG rule

after that i am getting stuck because anything i try to delete , it has association with some other resource.

Help me

Hi Rahul,

everything is connected to the instance, no? You can't deprovision sec
groups, network stuff or key_pairs while they are in use.

You'll have to remove the instance first.

Regards
Sebastian

Thanks Sebastien . I removed instance. but rest of all resources , i am not able to predict order, below is my playbook:

I have access to various Openstack clusters from different providers
and I found it was very much dependent on the way the cluster has been
setup, and also what version of openstack component were used.
It was hard to create a generic role/playbook that works well across
those providers.
Similarly, because of the different dependencies, destroying resources
was non-trivial, each provider was different.

Dick

Hi dick
I am using Red hat distribution of Openstack.
And openstack --verison =3.19.0

Though , Currently i am just targeting one instance (and not even stack) for starting purpose and i want to use
only red hat openstack platform and no other provider.