# How to use the different parameter for each host in playbook

**URL:** <https://forum.ansible.com/t/how-to-use-the-different-parameter-for-each-host-in-playbook/29805>\
**Category:** Ansible Project\
**Created:** [March 1, 2019, 1:36pm UTC](https://forum.ansible.com/t/how-to-use-the-different-parameter-for-each-host-in-playbook/29805 "2019-03-01T13:36:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devesh\_singh](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@Devesh\_singh](https://forum.ansible.com/u/Devesh_singh)\
**Post date:** [March 1, 2019, 1:36pm UTC](https://forum.ansible.com/t/how-to-use-the-different-parameter-for-each-host-in-playbook/29805/1 "2019-03-01T13:36:41Z")

</div>

Hi,

Could you please anyone help me to complete below request.

We need to excute the one playbook on 10 hosts and each task in playbook should use the different-2 parameter on each host.

Could you please how we can perform it.

Your prompt response will be appreciable for the same.

Thanks & Regards,  
Devesh Kumar Singh

---

<div class="post-metadata">

**Author:** ![Sudheer\_S1](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Sudheer\_S1](https://forum.ansible.com/u/Sudheer_S1)\
**Post date:** [March 1, 2019, 2:17pm UTC](https://forum.ansible.com/t/how-to-use-the-different-parameter-for-each-host-in-playbook/29805/2 "2019-03-01T14:17:40Z")

</div>

Tell us what are those 'different-2 parameter' are?

---

<div class="post-metadata">

**Author:** ![Jeffrey\_Agnitsch](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@Jeffrey\_Agnitsch](https://forum.ansible.com/u/Jeffrey_Agnitsch)\
**Post date:** [March 1, 2019, 2:41pm UTC](https://forum.ansible.com/t/how-to-use-the-different-parameter-for-each-host-in-playbook/29805/3 "2019-03-01T14:41:37Z")

</div>

One playbook on 10 hosts with two different parameters.

What are the two parameters?

if its just general data you can use some tasks to create the variable on the machine such as below with the set fact to make a variable with the contents of a password

you could have some tasks within the playbook to in this case set a password

name: Setup password  
set\_fact: root\_db\_server\_pwd={{lookup(‘password’, ‘/dev/null chars=ascii\_letters,digits,hexdigits length=10’)}}

You could also run some commands and register the output of those commands to be used later.

Could you be a little more specific on what you are trying to accomplish?

---

<div class="post-metadata">

**Author:** ![Robert\_Bellarmin](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@Robert\_Bellarmin](https://forum.ansible.com/u/Robert_Bellarmin)\
**Post date:** [March 4, 2019, 3:08pm UTC](https://forum.ansible.com/t/how-to-use-the-different-parameter-for-each-host-in-playbook/29805/4 "2019-03-04T15:08:49Z")

</div>


