# Importing a spreadsheet into Ansible

**URL:** <https://forum.ansible.com/t/importing-a-spreadsheet-into-ansible/24093>\
**Category:** Ansible Project\
**Created:** [March 29, 2017, 7:44am UTC](https://forum.ansible.com/t/importing-a-spreadsheet-into-ansible/24093 "2017-03-29T07:44:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![darren.smith](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@darren.smith](https://forum.ansible.com/u/darren.smith)\
**Post date:** [March 29, 2017, 7:44am UTC](https://forum.ansible.com/t/importing-a-spreadsheet-into-ansible/24093/1 "2017-03-29T07:44:40Z")

</div>

Hi, I am very new to Ansible and rightly or wrongly I am trying to apply my old scripting knowledge to the product which may or may not be the right thing to do! So I was hoping people could steer me in the right direction for the challenge I have.

We are looking to deploy Ansible and Ansible Tower to build out complete infrastructures (SDN, Compute etc). The first challenge I have come across is that I cannot find an easy way to import data from a spreadsheet into Ansible. We will have all the configuration details for X amount of virtual machines, and we don’t want to then have to manually enter these into a web form. I can fairly easily convert the spreadsheet to CSV or XML but will take a fair amount more work to convert it to a yml file, so my preference is to keep it as CSV or XML. I have looked and looked on the web for importing entire CSV files and have had little luck with the lookup(‘csvfile’) command. So my question is:

Is there an easier way of doing this within Ansible am I approaching this incorrectly for this platform?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 3, 2017, 2:01pm UTC](https://forum.ansible.com/t/importing-a-spreadsheet-into-ansible/24093/2 "2017-04-03T14:01:06Z")

</div>

I would make an inventory script (csv to json libraries abound), this  
should be good enough to get you started.
