# Parameterize the HostName & HostKey in the hosts file

**URL:** <https://forum.ansible.com/t/parameterize-the-hostname-hostkey-in-the-hosts-file/15629>\
**Category:** Ansible Project\
**Created:** [July 9, 2014, 8:33am UTC](https://forum.ansible.com/t/parameterize-the-hostname-hostkey-in-the-hosts-file/15629 "2014-07-09T08:33:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suresh\_Katta](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Suresh\_Katta](https://forum.ansible.com/u/Suresh_Katta)\
**Post date:** [July 9, 2014, 8:33am UTC](https://forum.ansible.com/t/parameterize-the-hostname-hostkey-in-the-hosts-file/15629/1 "2014-07-09T08:33:10Z")

</div>

Hi,

I’m a newbie in Ansible and trying for a solution to this issue.

We have a jenkins server on one machine which is connected to all the Dev, Test & Prod instances.  
So now on Jenkins Server, by using the Jenkins UI we will be able to deploy / configure the instances using playbooks created and for now we had given the hostname and keys in the host files while preparing the playbook.

Is there a possibility to parametrize the hostname and hostkey location and pass them in the UI.

Thanks,  
Suresh

---

<div class="post-metadata">

**Author:** ![Henry\_Finucane](https://avatars.discourse-cdn.com/v4/letter/h/94ad74/32.png) [@Henry\_Finucane](https://forum.ansible.com/u/Henry_Finucane)\
**Post date:** [July 9, 2014, 3:09pm UTC](https://forum.ansible.com/t/parameterize-the-hostname-hostkey-in-the-hosts-file/15629/2 "2014-07-09T15:09:33Z")

</div>

If you have a separate inventory for dev, test, and prod, you could have jenkins choose the environment, and keep the hostnames, etc, in the inventory.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 9, 2014, 7:50pm UTC](https://forum.ansible.com/t/parameterize-the-hostname-hostkey-in-the-hosts-file/15629/3 "2014-07-09T19:50:38Z")

</div>

Take a look at --extra-args. Should be easy to pass parameterized Jenkins parameters down that way.

You may also be interested in Ansible Tower that provides more shiny alternatives and also some better access control and credential sharing.
