# variable list with inventory script

**URL:** <https://forum.ansible.com/t/variable-list-with-inventory-script/13680>\
**Category:** Ansible Project\
**Created:** [October 15, 2013, 2:00pm UTC](https://forum.ansible.com/t/variable-list-with-inventory-script/13680 "2013-10-15T14:00:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_Van\_der\_Kuss](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@Vincent\_Van\_der\_Kuss](https://forum.ansible.com/u/Vincent_Van_der_Kuss)\
**Post date:** [October 15, 2013, 2:00pm UTC](https://forum.ansible.com/t/variable-list-with-inventory-script/13680/1 "2013-10-15T14:00:47Z")

</div>

Hi,

I’m using an inventory based on LDAP and have my own script to get the value sout of it. Currently I could only specify one value to a variable. I now changed the script a bit so I can get more.

This is an example from the output

→ ./ldap\_inv.py --host infra-16.prod.btr.local [devel]  
{  
“scripts”: [  
“SVN\_BACKUP\_AFTER.sh”,  
“SVN\_BACKUP.sh”  
]  
}

In my playbook I want to iterate over the “scripts” list in a copy command like this

- name: deploy backup script  
action: copy src={{ item }} dest=/var/scripts/{{ item }}  
with\_items: scripts

This is what the playbook run returns

TASK: [deploy backup script] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [infra-16.prod.btr.local] =\> input file not found at /home/vincent/BTR\_INFRA/ansible/playbooks/roles/s3backup/files/SVN\_BACKUP\_AFTER.sh,SVN\_BACKUP.sh or /home/vincent/BTR\_INFRA/ansible/playbooks/SVN\_BACKUP\_AFTER.sh,SVN\_BACKUP.sh

Both values are being pasted together.

What am I doing wrong?

\_Vincent

---

<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 15, 2013, 2:13pm UTC](https://forum.ansible.com/t/variable-list-with-inventory-script/13680/2 "2013-10-15T14:13:29Z")

</div>

Is that the exact output of your inventory script?

Seems like there is a good chance it might not be.
