how to pass ansible variables from Jenkins by using parameters

27 views
Skip to first unread message

kumar kittu

unread,
Oct 24, 2018, 2:40:34 AM10/24/18
to Ansible Project
Hello All,

I have ansible-playbook which has variables defined and that playbook is executed successfully from jenkins by creating job.

my query is :

I need to pass ansible variables defined in playbook from jenkins ,as parameter(or what ever),so it would eliminate hard coding in ansible-playbook.

Searched a lot but couldn't get exact solution.

Request anyone to help me at the earliest

Thanks in advance

Adrian Sebastian Dutu

unread,
Oct 24, 2018, 4:42:42 AM10/24/18
to Ansible Project
-e allows you to pass variables to the command line. So you can put that in your job. Also, there's an ansible jenkins plugin. You can take a look at that.

kumar kittu

unread,
Oct 24, 2018, 5:55:18 AM10/24/18
to Ansible Project
Thanks Adrian 

command line parameters we could give ,but that also we need to open jenkins job and then add the variables.
My intention is we just give parameter like string parameter in jenkins and it would map to ansible variables .
Request to help me.
Reply all
Reply to author
Forward
0 new messages