# How to loop on a parameter file the play of the playbook

**URL:** <https://forum.ansible.com/t/how-to-loop-on-a-parameter-file-the-play-of-the-playbook/21189>\
**Category:** Ansible Project\
**Created:** [April 18, 2016, 9:18am UTC](https://forum.ansible.com/t/how-to-loop-on-a-parameter-file-the-play-of-the-playbook/21189 "2016-04-18T09:18:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fanvalt](https://avatars.discourse-cdn.com/v4/letter/f/2bfe46/32.png) [@fanvalt](https://forum.ansible.com/u/fanvalt)\
**Post date:** [April 18, 2016, 9:18am UTC](https://forum.ansible.com/t/how-to-loop-on-a-parameter-file-the-play-of-the-playbook/21189/1 "2016-04-18T09:18:14Z")

</div>

Hello,

I would like to use only parameters in my playbook and so to use an external variables file to set the host, user, http parameters etc … so my playbook would loop on it.  
Is this possible ?

Here is an explaination of my needs:  
I would like noone has to modify the playbook to set the parameters, I want all variables to be external variables.

I’d like to give the following informations when playing the playbook:

host=server1, user=user1, http\_port=8080, release=1.2  
host=server1, user=user2, http\_port=8081, release=2.3  
host=server2, user=user1, http\_port=8080, release=2.3  
etc …

Is using the hosts file a way to do so,are we allowed to set any parameters we want like:  
[deployed\_server]  
server1 user=user1 http\_port=8080 release=1.2  
server2 user=user1 http\_port=8080 release=2.3  
or can we only pass ansible variables in the hosts file ?

My purpose would be to allowed a user to create a file in EXcel and to transfer is on the ansible master host and then the playbook would be run with this excel file as an external parameter file.

Any clue ?  
Regards

---

<div class="post-metadata">

**Author:** ![fanvalt](https://avatars.discourse-cdn.com/v4/letter/f/2bfe46/32.png) [@fanvalt](https://forum.ansible.com/u/fanvalt)\
**Post date:** [April 19, 2016, 10:32am UTC](https://forum.ansible.com/t/how-to-loop-on-a-parameter-file-the-play-of-the-playbook/21189/2 "2016-04-19T10:32:10Z")

</div>

Done, I did use an array to set the parameters in the hosts file
