# paramaterized roles - how to do line break or pass args as a list?

**URL:** <https://forum.ansible.com/t/paramaterized-roles-how-to-do-line-break-or-pass-args-as-a-list/21485>\
**Category:** Ansible Project\
**Created:** [May 18, 2016, 8:30pm UTC](https://forum.ansible.com/t/paramaterized-roles-how-to-do-line-break-or-pass-args-as-a-list/21485 "2016-05-18T20:30:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_McAlvin](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@Eric\_McAlvin](https://forum.ansible.com/u/Eric_McAlvin)\
**Post date:** [May 18, 2016, 8:30pm UTC](https://forum.ansible.com/t/paramaterized-roles-how-to-do-line-break-or-pass-args-as-a-list/21485/1 "2016-05-18T20:30:21Z")

</div>

I have tried figuring this out for a few hours now and can’t get it working…

Does anyone know how to properly format this so the code isn’t so wide?

- hosts: 127.0.0.1

connection: local

gather\_facts: no

roles:

- { role: vsphere-guest, vm\_name: ‘{{server1\_hostname}}’, ip\_addr: ‘{{server1\_ip.stdout}}’, ip\_mask: ‘{{ip\_mask}}’, ip\_gateway: ‘{{ip\_gateway}}’, fqdn: ‘{{server1\_hostname}}’, vm\_memsize: ‘{{vm\_memsize}}’, vm\_numcpus: ‘{{vm\_numcpus}}’, vcenter\_username: ‘{{ vcenter[vsphere\_environment].username }}’, vcenter\_password: ‘{{ vcenter[vsphere\_environment].password }}’, tags: [‘create\_vms’, ‘create\_vm1’] }

Thanks!

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 19, 2016, 7:45am UTC](https://forum.ansible.com/t/paramaterized-roles-how-to-do-line-break-or-pass-args-as-a-list/21485/2 "2016-05-19T07:45:58Z")

</div>

According to the docs  
([https://docs.ansible.com/ansible/YAMLSyntax.html](https://docs.ansible.com/ansible/YAMLSyntax.html)), I would try this:

...  
&nbsp;&nbsp;roles:  
&nbsp;&nbsp;&nbsp;&nbsp;- role: vsphere-guest  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vm\_name: '{{server1\_hostname}}'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ip\_addr: '{{server1\_ip.stdout}}'

Can't test at the moment. And I am not sure about the "# Employee  
records" example, which the docs show as abbreviated. In the example  
there is a string martin in front of the whole dict.

Johannes

---

<div class="post-metadata">

**Author:** ![Eric\_McAlvin](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@Eric\_McAlvin](https://forum.ansible.com/u/Eric_McAlvin)\
**Post date:** [May 19, 2016, 2:54pm UTC](https://forum.ansible.com/t/paramaterized-roles-how-to-do-line-break-or-pass-args-as-a-list/21485/3 "2016-05-19T14:54:18Z")

</div>

Your brilliant. That worked!

Here is the working example:
