# Ansible for openstack

**URL:** <https://forum.ansible.com/t/ansible-for-openstack/30949>\
**Category:** Ansible Project\
**Created:** [August 5, 2019, 7:19am UTC](https://forum.ansible.com/t/ansible-for-openstack/30949 "2019-08-05T07:19:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Kumar1](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Rahul\_Kumar1](https://forum.ansible.com/u/Rahul_Kumar1)\
**Post date:** [August 5, 2019, 7:19am UTC](https://forum.ansible.com/t/ansible-for-openstack/30949/1 "2019-08-05T07:19:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sebastian\_Meyer](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@Sebastian\_Meyer](https://forum.ansible.com/u/Sebastian_Meyer)\
**Post date:** [August 5, 2019, 7:39am UTC](https://forum.ansible.com/t/ansible-for-openstack/30949/2 "2019-08-05T07:39:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rahul\_Kumar1](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Rahul\_Kumar1](https://forum.ansible.com/u/Rahul_Kumar1)\
**Post date:** [August 5, 2019, 7:48am UTC](https://forum.ansible.com/t/ansible-for-openstack/30949/3 "2019-08-05T07:48:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 5, 2019, 8:26am UTC](https://forum.ansible.com/t/ansible-for-openstack/30949/4 "2019-08-05T08:26:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rahul\_Kumar1](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Rahul\_Kumar1](https://forum.ansible.com/u/Rahul_Kumar1)\
**Post date:** [August 5, 2019, 8:32am UTC](https://forum.ansible.com/t/ansible-for-openstack/30949/5 "2019-08-05T08:32:03Z")

</div>

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.
