# How to pass a long list a variables to a script, comma seperated in double quotes ?

**URL:** <https://forum.ansible.com/t/how-to-pass-a-long-list-a-variables-to-a-script-comma-seperated-in-double-quotes/35551>\
**Category:** Ansible Project\
**Created:** [July 27, 2021, 12:43pm UTC](https://forum.ansible.com/t/how-to-pass-a-long-list-a-variables-to-a-script-comma-seperated-in-double-quotes/35551 "2021-07-27T12:43:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![omoeko](https://avatars.discourse-cdn.com/v4/letter/o/e47774/32.png) [@omoeko](https://forum.ansible.com/u/omoeko)\
**Post date:** [July 27, 2021, 12:43pm UTC](https://forum.ansible.com/t/how-to-pass-a-long-list-a-variables-to-a-script-comma-seperated-in-double-quotes/35551/1 "2021-07-27T12:43:55Z")

</div>

Hi All.

I currently pass a comma seperated list of variables to my ansible tower template in this matter

param1: xxxxx  
server\_port\_list: “‘server1,4455’,‘server2,7777’,‘server3,5588’”

I have a file which has the contents below.

server1,4455  
server2,7777  
server3,5588

I have written the playbook in such a way that I now have access to the file.

I use the snippet below to read the file content.

- name: read file content  
win\_shell: type {{server\_list}}  
register: my\_server\_list

I need it passed to my script in this format, “‘server1,4455’,‘server2,7777’,‘server3,5588’”

How can i do this in ansible ?
