# lists as arguments

**URL:** <https://forum.ansible.com/t/lists-as-arguments/13742>\
**Category:** Ansible Project\
**Created:** [October 22, 2013, 11:38am UTC](https://forum.ansible.com/t/lists-as-arguments/13742 "2013-10-22T11:38:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nandor\_Sivok](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@Nandor\_Sivok](https://forum.ansible.com/u/Nandor_Sivok)\
**Post date:** [October 22, 2013, 11:38am UTC](https://forum.ansible.com/t/lists-as-arguments/13742/1 "2013-10-22T11:38:52Z")

</div>

Hello,

I would like to pass a list of strings as an argument to one of my playbook to iterate it through in a with\_items block.

what I’m trying to do is:

ansible-playbook a.yml -e “items=[‘test1’,‘test2’]”

---

<div class="post-metadata">

**Author:** ![Michel\_Blanc1](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@Michel\_Blanc1](https://forum.ansible.com/u/Michel_Blanc1)\
**Post date:** [October 22, 2013, 11:43am UTC](https://forum.ansible.com/t/lists-as-arguments/13742/2 "2013-10-22T11:43:33Z")

</div>

Hi Nandor,

The syntax is wrong at the CLI and in the playbook :

ansible-playbook a.yml -e "{items:['test1','test2']}"

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 22, 2013, 2:40pm UTC](https://forum.ansible.com/t/lists-as-arguments/13742/3 "2013-10-22T14:40:35Z")

</div>

Yep, it takes JSON if you want to pass structured data.
