Parameterize the HostName & HostKey in the hosts file

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

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.

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.