# ACI - Using CSV import to map out variables to be consumed by playbook.

**URL:** <https://forum.ansible.com/t/aci-using-csv-import-to-map-out-variables-to-be-consumed-by-playbook/30874>\
**Category:** Ansible Project\
**Created:** [July 25, 2019, 10:24pm UTC](https://forum.ansible.com/t/aci-using-csv-import-to-map-out-variables-to-be-consumed-by-playbook/30874 "2019-07-25T22:24:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tariq\_Iqbal](https://avatars.discourse-cdn.com/v4/letter/t/7bcc69/32.png) [@Tariq\_Iqbal](https://forum.ansible.com/u/Tariq_Iqbal)\
**Post date:** [July 25, 2019, 10:24pm UTC](https://forum.ansible.com/t/aci-using-csv-import-to-map-out-variables-to-be-consumed-by-playbook/30874/1 "2019-07-25T22:24:38Z")

</div>

Hello All,

I am using a module CSV to FACTS that takes in a CSV and converts it to dictionary. I am trying to iterate over the dictionary and map them to variables and these variables will be used in the playbook.

Question: how to loop through the dictionary that is created by CSV\_TO\_FACTS Module and map them to a variable?

Here is my YML script:

---

<div class="post-metadata">

**Author:** ![Thomas\_Renzy](https://avatars.discourse-cdn.com/v4/letter/t/a9adbd/32.png) [@Thomas\_Renzy](https://forum.ansible.com/u/Thomas_Renzy)\
**Post date:** [July 26, 2019, 5:05pm UTC](https://forum.ansible.com/t/aci-using-csv-import-to-map-out-variables-to-be-consumed-by-playbook/30874/2 "2019-07-26T17:05:22Z")

</div>

Hi Tariq,

What version of Ansible are you using? I am using the CSV module to do exactly what you are doing, but it’s only available in 2.8.

Thanks,  
Thomas
