mk7
mk7

Reputation: 215

Chef-jenkins plugin not recognising the jenkins parameter

I have installed the chef-client plugin (https://github.com/melezhik/chef-plugin/) on to Jenkins to be able to trigger the chef client run from Jenkins. I have configured a String parameter in the Jenkins job, and need to use that parameter as the ssh host for the chef client run in the job config.

But I am unable to reference the Jenkins parameters in the ssh host field of the chef plugin. I have tried the standard Jenkins way of referencing parameters as $PARAMETER and also the ruby way as env["PARAMETER"] but the ssh host is unable to recognise the parameter. Any help on how I could parameterise the ssh host field would be much appreciated.

Attaching some screenshots for more clarity.enter image description here

enter image description here

EDIT: Adding the console output:

[2015-03-18 15:58:41 +1100] INFO: rendering ERB template
[2015-03-18 15:58:41 +1100] INFO: parsing JSON string
[2015-03-18 15:58:41 +1100] INFO: saving JSON to file
[2015-03-18 15:58:41 +1100] INFO: chef json url => http://localhost:8080//job/Chef-Client/ws/chef.json
[2015-03-18 15:58:41 +1100] INFO: host => $HOST_TEST
$ bash -c "ssh jenkins@$HOST_TEST sudo chef-client -l info -j http://localhost:8080//job/Chef-Client/ws/chef.json  "
ssh: Could not resolve hostname : Name or service not known
ERROR:  (Java::Hudson::AbortException)
sun.reflect.GeneratedConstructorAccessor114.newInstance(Unknown Source)

Upvotes: 0

Views: 284

Answers (1)

Dr.Bokko
Dr.Bokko

Reputation: 116

Looking at the code on

https://github.com/melezhik/chef-plugin

it seems that parameters (which are used as environment variables) are not supported by this plugin (v.0.1.3)

Upvotes: 1

Related Questions