# Ansible for Openstack

**URL:** <https://forum.ansible.com/t/ansible-for-openstack/30915>\
**Category:** Ansible Project\
**Created:** [July 31, 2019, 10:04am UTC](https://forum.ansible.com/t/ansible-for-openstack/30915 "2019-07-31T10:04:55Z")\
**Posts on this page:** 1\
**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:** [July 31, 2019, 10:04am UTC](https://forum.ansible.com/t/ansible-for-openstack/30915/1 "2019-07-31T10:04:55Z")

</div>

Hi All,  
I am trying to create complete stack of Openstack as below snippet:  
os\_server:  
name: “{{ prefix }}-{{ [item.name](http://item.name) }}”  
state: present  
key\_name: “{{ item.key }}”  
availability\_zone: “{{ item.availability\_zone }}”  
nics: “{{ item.nics }}”  
image: “{{ item.image }}”  
flavor: “{{ item.flavor }}”  
with\_items: “{{ servers }}”  
register: “os\_hosts”

- name: Create Networks  
os\_network:  
name: “{{ [item.name](http://item.name) }}”  
state: present  
external: false  
wait: yes  
with\_items: “{{ networks }}”

I am trying to understand , how I can make dependencies of one task to another. For example in above example:  
If network does not exist (with the specfified ID item.nics ), then create the one using 2nd task ? And since its mutlinetworks and multiserver mode, how we ensure that particular server is attached to particular network, does this needs to be taken care while defining those variables or anything else in playbook we can do?

Rahul
