rtyler/puppet-jenkins

Downloads modules every time

Boran opened this issue · 8 comments

When using jenkins::plugin to install modules, it downloads the modules on every puppet run. So it one has many modules that can take a few minutes and is inefficient - especially if the puppet agent runs often.

Maybe I've misunderstood something?
For now I'll use jenkins::plugin to install new plugins, but then comment them out in site.pp to make sure its not redone. Not ideal though?

Are you then going and updating them? The plugin code looks for the existance of the specific file, which the update center moves & cleans up. That can cause this..

I've not touched the Jenkins gui yet, just automating as much of the install as possible with puppet.
jenkins::plugin { "ant" : ; "credentials" : ; "external-monitor-job" : ; "git" : ; "git-parameter" : ; "git-client" : ; "greenballs" : ; "htmlpublisher" : ; "javadoc" : ; "cvs" : ; "mailer" : ; "ssh-slaves" : ; "ssh-credentials" : ; "subversion" : ; "translation" : ; "maven-plugin" : ; "maven-info" : ; "pam-auth" : ; "artifactory" : ; "findbugs" : ; "jenkinswalldisplay" : ; "github" : ; }
When the above is enabled, each puppet run take 2 minutes and results in entries like the following
info: Applying configuration version '1369148771' notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[maven-plugin]/File[/var/lib/jenkins/plugins/maven-plugin.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[maven-plugin]/File[/var/lib/jenkins/plugins/maven-plugin.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ssh-slaves]/Exec[download-ssh-slaves]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[cvs]/File[/var/lib/jenkins/plugins/cvs.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[cvs]/File[/var/lib/jenkins/plugins/cvs.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[mailer]/Exec[download-mailer]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[javadoc]/File[/var/lib/jenkins/plugins/javadoc.hpi]/owner: owner changed 'root' to 'jenkins'
I'm not a jenkins user myself, yet - just a sysadmin. So apologies in advance if I'm missing something obvious.

Some of those look like they are default plugins that are installed internally. I suspect it's failing on those, or erasing those files that the module is looking for.

For example, do you see findbugs in the output each time?

If not, you can probabaly start commenting out the modules that are getting downloaded each time. CVS and many of the others you mention are default plugins and installed by the package.

How did you get the list of plugins to install? Starting from a clean install, and seeing what you need to install after that is helpful, too.

Another note: If you have trouble w/ a plugin not showing up and working, check to make sure it's dependencies are installed. The plugin module won't install dependencies right now.

(It's not a problem being only the SA- that's me, too. I've just had to learn a bit about this app :)

"only SA": heh - point taken.

I was given the list of modules by a developer.
Dont see find bugs each time.
For now, I just disable the jenkins::plugin stanza, except when I've new plugins to install.
Thanks and regards,

You can do that, but it's only an issue because you're trying to install a plugin that's actually named something else, so it moves it for you when jenkins starts.

Once I get around to writing the package provider for Jenkins, that should go away.. but it might still be a problem for you, since you might not be able to talk from Jenkins to the outside world without setting up the http proxy for Jenkins itself.

Well, I didn't want to take up your time, but to be more precise, the list of plugins given to puppet is:
jenkins::plugin { "ant" : ; "credentials" : ; "deploy" : ; "external-monitor-job" : ; "git" : ; "git-parameter" : ; "git-client" : ; "greenballs" : ; "htmlpublisher" : ; "javadoc" : ; "cvs" : ; "mailer" : ; "ssh-slaves" : ; "ssh-credentials" : ; "subversion" : ; "translation" : ; "maven-plugin" : ; "maven-info" : ; "pam-auth" : ; "artifactory" : ; "github" : ; }

But not all modules are re-installed each time:

info: Applying configuration version '1369228653' notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[cvs]/Exec[download-cvs]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[javadoc]/Exec[download-javadoc]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[external-monitor-job]/Exec[download-external-monitor-job]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[external-monitor-job]/File[/var/lib/jenkins/plugins/external-monitor-job.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[external-monitor-job]/File[/var/lib/jenkins/plugins/external-monitor-job.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[translation]/Exec[download-translation]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[translation]/File[/var/lib/jenkins/plugins/translation.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[translation]/File[/var/lib/jenkins/plugins/translation.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[maven-plugin]/Exec[download-maven-plugin]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[maven-plugin]/File[/var/lib/jenkins/plugins/maven-plugin.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[maven-plugin]/File[/var/lib/jenkins/plugins/maven-plugin.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ssh-slaves]/Exec[download-ssh-slaves]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[cvs]/File[/var/lib/jenkins/plugins/cvs.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[cvs]/File[/var/lib/jenkins/plugins/cvs.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[mailer]/Exec[download-mailer]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[javadoc]/File[/var/lib/jenkins/plugins/javadoc.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[javadoc]/File[/var/lib/jenkins/plugins/javadoc.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ssh-slaves]/File[/var/lib/jenkins/plugins/ssh-slaves.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ssh-slaves]/File[/var/lib/jenkins/plugins/ssh-slaves.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[mailer]/File[/var/lib/jenkins/plugins/mailer.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[mailer]/File[/var/lib/jenkins/plugins/mailer.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ant]/Exec[download-ant]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ant]/File[/var/lib/jenkins/plugins/ant.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ant]/File[/var/lib/jenkins/plugins/ant.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ssh-credentials]/Exec[download-ssh-credentials]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ssh-credentials]/File[/var/lib/jenkins/plugins/ssh-credentials.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[ssh-credentials]/File[/var/lib/jenkins/plugins/ssh-credentials.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[credentials]/Exec[download-credentials]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[credentials]/File[/var/lib/jenkins/plugins/credentials.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[subversion]/Exec[download-subversion]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[subversion]/File[/var/lib/jenkins/plugins/subversion.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[subversion]/File[/var/lib/jenkins/plugins/subversion.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[pam-auth]/Exec[download-pam-auth]/returns: executed successfully notice: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[pam-auth]/File[/var/lib/jenkins/plugins/pam-auth.hpi]/owner: owner changed 'root' to 'jenkins' info: /Stage[main]//Node[jenkins-dev]/Jenkins::Plugin[pam-auth]/File[/var/lib/jenkins/plugins/pam-auth.hpi]: Scheduling refresh of Service[jenkins] notice: /Stage[main]/Jenkins::Service/Service[jenkins]: Triggered 'refresh' from 12 events notice: Finished catalog run in 27.36 seconds

Well, that's what i was expecting:

Comment out / get rid of: Ant, Credentials, SSH Credentials, CVS, pam-auth, subversion, mailer, ssh slaves, javadoc, maven-plugin, translation, external-monitor-job,

Which is pretty much just checking which plugins it's trying to install a second time, and removing them from the list. These all are originally part of the core distribution...

Ok, I understand better. The puppet run now only take 2 secons, with 8 modules enabled, that do no reinstall. Thanks again!