# How to use array of hash in yml?

**URL:** <https://forum.ansible.com/t/how-to-use-array-of-hash-in-yml/14443>\
**Category:** Ansible Project\
**Created:** [January 28, 2014, 3:05pm UTC](https://forum.ansible.com/t/how-to-use-array-of-hash-in-yml/14443 "2014-01-28T15:05:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![howachen](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@howachen](https://forum.ansible.com/u/howachen)\
**Post date:** [January 28, 2014, 3:05pm UTC](https://forum.ansible.com/t/how-to-use-array-of-hash-in-yml/14443/1 "2014-01-28T15:05:12Z")

</div>

I know we can use array in yml, e.g.

web\_servers:

- “server.1=host1”

- “server.2=host2”

- “server.3=host3”

However, will it be possible to use array of hash/dictionary?

Thanks.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [January 28, 2014, 3:49pm UTC](https://forum.ansible.com/t/how-to-use-array-of-hash-in-yml/14443/2 "2014-01-28T15:49:38Z")

</div>

yes, yaml lets you use any combo of hash/dictionary with list/array that you can come up with.

webservers:- 1: host1

- 2: host2

- 3: host3
