Ich baue ein Kochbuch in Chef, um einen automatisierten Dienst in Jenkins zu erstellen. Ich installiere das neueste Jenkins LTS auf CentOS, aber mir wird ständig der Zugriff auf die JAR-Datei verweigert. Hat jemand eine Lösung, um dies zu überschreiben?Zugriff auf Jenkins JAR beim Start
Hier ist meine Ausgabe:
* remote_file[/var/lib/jenkins/plugins/jenkins-cli.jar] action create[2016-07-31T16:35:43+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 1/5
[2016-07-31T16:35:48+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 2/5
[2016-07-31T16:35:53+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 3/5
[2016-07-31T16:35:58+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 4/5
[2016-07-31T16:36:03+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 5/5
[2016-07-31T16:36:08+00:00] WARN: remote_file[/var/lib/jenkins/plugins/jenkins-cli.jar] cannot be downloaded from http://localhost:8080/jnlpJars/jenkins-cli.jar: Connection refused - Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, giving up
================================================================================
Error executing action `create` on resource 'remote_file[/var/lib/jenkins/plugins/jenkins-cli.jar]'
================================================================================
Errno::ECONNREFUSED
-------------------
Connection refused - Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, giving up
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action'
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/fanatics_pipeline/recipes/jenkins_plugins.rb
44: remote_file "#{node['plugins_dir']}/jenkins-cli.jar" do
45: source node['cli_jar']
46: action :create
47: mode '0755'
48: notifies :restart, "service[#{node['repo']['name']}]", :delayed
49: end
50: end
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/fanatics_pipeline/recipes/jenkins_plugins.rb:44:in `block in from_file'
remote_file("/var/lib/jenkins/plugins/jenkins-cli.jar") do
provider Chef::Provider::RemoteFile
action [:create]
retries 0
retry_delay 2
default_guard_interpreter :default
source ["http://localhost:8080/jnlpJars/jenkins-cli.jar"]
use_etag true
use_last_modified true
declared_type :remote_file
cookbook_name "fanatics_pipeline"
recipe_name "jenkins_plugins"
mode "0755"
atomic_update true
path "/var/lib/jenkins/plugins/jenkins-cli.jar"
end
Platform:
---------
x86_64-linux
Recipe: fanatics_pipeline::jenkins_install
* service[jenkins] action restart
- restart service service[jenkins]
* service[jenkins] action reload
- reload service service[jenkins]
Running handlers:
[2016-07-31T16:36:15+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-07-31T16:36:15+00:00] ERROR: Exception handlers complete
Chef Client failed. 24 resources updated in 04 minutes 10 seconds
[2016-07-31T16:36:15+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2016-07-31T16:36:15+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-07-31T16:36:15+00:00] ERROR: remote_file[/var/lib/jenkins/plugins/jenkins-cli.jar] (fanatics_pipeline::jenkins_plugins line 44) had an error: Errno::ECONNREFUSED: Connection refused - Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, giving up
[2016-07-31T16:36:17+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Ich glaube, das Problem ist ein Firewall-Problem, aber die Lösungen auf der Jenkins-Website haben nicht viel geholfen. Aus irgendeinem Grund darf Chef beim Erstellen und Konfigurieren von Jenkins keine integrierten Plugins vom laufenden Jenkins-Server herunterladen. –
Leider hat Linux viele verschiedene Firewall-Kontroll-Tools. Ohne zu wissen, was Sie verwenden, kann ich nicht genauer sein. – coderanger