[chef] Setting up jenkins slaves using chef


Chronological Thread 
  • From: Peter Hoellig < >
  • To: " " < >
  • Subject: [chef] Setting up jenkins slaves using chef
  • Date: Mon, 24 Jun 2013 18:38:56 +0000
  • Accept-language: en-US

Hello and thanks in advance,

Is there any setup that must be done on the jenkins master before the jenkins chef cookbook can create a slave node?

I'm working with the Jenkins cookbook (0.6.3 from http://community.opscode.com/cookbooks/jenkins) trying to setup a windows slave and having a bit of trouble. I was able to setup a Jenkins master on Ubuntu without issue and I'm getting errors creating the jenkins-slave.xml when running chef-client on the slave node. I've already verified that my DNS settings are correct and that I'm hitting the server. 

I've created a role on my chef server which contains the java:windows (this works and installs fine) and jenkins:node_windows recipes and overridden attributes as follows. 
{
    "java":
    {
        "jdk_version":"7",
        "windows":{"url":"http://pathToJavaInstaller"}
    },
    "jenkins":
    {
        "server":
        {
             "url":"http://pathToJenkinsMaster:8080"
}}}

Here is the relevant output that I'm seeing:
 ================================================================================
 Error executing action `create` on resource 'template[C:/jenkins/jenkins-slave.xml]'
 ================================================================================
 
 
 Chef::Exceptions::FileNotFound
 ------------------------------
 Cookbook 'jenkins' (0.6.3) does not contain a file at any of these locations:
   templates/windows-6.1.7601/jenkins-slave.xml
   templates/windows/jenkins-slave.xml
   templates/default/jenkins-slave.xml
 
 This cookbook _does_ contain: ['apache_jenkins.erb','htpasswd.erb','jenkins.erb','nginx_jenkins.conf.erb','port_jenkins.erb','sv-hudson-slave-log-run.erb','sv-hudson-slave-run.erb']
 
 
 Resource Declaration:
 ---------------------
 # In c:/chef/cache/cookbooks/jenkins/recipes/node_windows.rb
 
  44: template "#{home}/jenkins-slave.xml" do
  45:   source "jenkins-slave.xml"
  46:   variables(:jenkins_home => home,
  47:             :jnlp_url => "#{url}/computer/#{node[:jenkins][:node][:name]}/slave-agent.jnlp")
  48: end
  49: 
 
 
 
 Compiled Resource:
 ------------------
 # Declared in c:/chef/cache/cookbooks/jenkins/recipes/node_windows.rb:44:in `from_file'
 
 template("C:/jenkins/jenkins-slave.xml") do
   provider Chef::Provider::Template
   action "create"
   retries 0
   retry_delay 2
   path "C:/jenkins/jenkins-slave.xml"
   backup 5
   source "jenkins-slave.xml"
   variables {:jenkins_home=>"C:/jenkins", :jnlp_url=>"http://pathToJenkinsMaster:8080/computer/nodeDNS/slave-agent.jnlp"}
   cookbook_name "jenkins"
   recipe_name "node_windows"
 end
 
 
 
 [2013-06-24T18:03:11+00:00] INFO: Running queued delayed notifications before re-raising exception
 [2013-06-24T18:03:11+00:00] ERROR: Running exception handlers
 [2013-06-24T18:03:11+00:00] FATAL: Saving node information to c:/chef/cache/failed-run-data.json
 [2013-06-24T18:03:11+00:00] ERROR: Exception handlers complete
 [2013-06-24T18:03:11+00:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
 [2013-06-24T18:03:11+00:00] FATAL: Chef::Exceptions::FileNotFound: template[C:/jenkins/jenkins-slave.xml] (jenkins::node_windows line 44) had an error: Chef::Exceptions::FileNotFound: Cookbook 'jenkins' (0.6.3) does not contain a file at any of these locations:
   templates/windows-6.1.7601/jenkins-slave.xml
   templates/windows/jenkins-slave.xml
   templates/default/jenkins-slave.xml
 
 This cookbook _does_ contain: ['apache_jenkins.erb','htpasswd.erb','jenkins.erb','nginx_jenkins.conf.erb','port_jenkins.erb','sv-hudson-slave-log-run.erb','sv-hudson-slave-run.erb']

Thanks!



Archive powered by MHonArc 2.6.16.

§