rtyler/puppet-jenkins

Invalid package repository being added for Ubuntu

Closed this issue · 4 comments

Running the current version succeeds, but installs the puppet version from the Canoncial repository, logging

notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: W: Failed to fetch http://pkg.jenkins-ci.org/debian/dists/precise/binary//binary-amd64/Packages  404  Not Found
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: 
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: W: Failed to fetch http://pkg.jenkins-ci.org/debian/dists/precise/binary//binary-i386/Packages  404  Not Found
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: 
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: E: Some index files failed to download. They have been ignored, or old ones used instead.
err: /Stage[main]/Apt::Update/Exec[apt_update]: Failed to call refresh: /usr/bin/apt-get update returned 100 instead of one of [0] at /home/knuton/devops/modules/apt/manifests/update.pp:8

The content of /etc/apt/sources.list.d/jenkins.list:

# jenkins
deb http://pkg.jenkins-ci.org/debian precise binary/

There are no precise-specific releases in the Jenkins repository, though, the entry should simply be deb http://pkg.jenkins-ci.org/debian binary/. (http://pkg.jenkins-ci.org/debian/)

On Debian, installation fails altogether, due to there being no jenkins package in the standard repository:

notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Err http://pkg.jenkins-ci.org squeeze/binary/ amd64 Packages
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns:   404  Not Found
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: W: Failed to fetch http://pkg.jenkins-ci.org/debian/dists/squeeze/binary//binary-amd64/Packages.gz  404  Not Found
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: 
notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: E: Some index files failed to download, they have been ignored, or old ones used instead.
err: /Stage[main]/Apt::Update/Exec[apt_update]: Failed to call refresh: /usr/bin/apt-get update returned 100 instead of one of [0] at /home/knuton/devops/modules/apt/manifests/update.pp:8
err: /Stage[main]/Jenkins::Package/Package[jenkins]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install jenkins' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package jenkins

notice: /Stage[main]/Jenkins::Service/Service[jenkins]: Dependency Package[jenkins] has failures: true
warning: /Stage[main]/Jenkins::Service/Service[jenkins]: Skipping because of failed dependencies
i

I assume that this might be due to a change in puppetlabs/puppetlabs-apt#74. My change in #22 was only a superficial fix for the surface problem of the disabled dynamic lookup of $lsbdistcodename in apt::source.

A workaround would be passing the string ' ' instead of '' (which was there before #22) in manifests/repo/debian.pp:

-    release     => $lsbdistcodename,
+    release     => ' ',

Not super clean, though, I reckon a proper solution needs to be added to apt.

Passing a string with a space (' ') seems to be the best fix as the Debian repo for Jenkins is a bit special. We can't expect apt to not use any release.

It would be great to fix this project instead. I can confirm both the bug and the fix on Debian and Ubuntu (latest versions), even with lsb-release installed.

This should be fixed with the resolution of #30 in the latest HEAD.

As soon as Puppet Forge cooperates, 0.2.4 will be uploaded there.