Recent versions of Chef Client include a core apt_repository resource instead of requiring the resource that came with the apt cookbook. The new core resource calculates a default value for the distribution property, "yakkety" in my case, which results in a /etc/apt/sources.list.d/sysdig.list that looks like this.
deb "http://download.draios.com/stable/deb" yakkety stable-$(ARCH)/
This causes the subsequent apt-get update to fail every time.
Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q update ----
STDOUT: Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu yakkety InRelease
Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu yakkety-updates InRelease
Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu yakkety-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu yakkety-security InRelease [102 kB]
Ign:5 http://download.draios.com/stable/deb stable-amd64/ InRelease
Ign:6 http://download.draios.com/stable/deb yakkety InRelease
Hit:7 http://download.draios.com/stable/deb stable-amd64/ Release
Ign:8 http://download.draios.com/stable/deb yakkety Release
Get:9 http://download.draios.com/stable/deb stable-amd64/ Release.gpg [490 B]
Ign:10 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ all Packages
Ign:11 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ amd64 Packages
Ign:12 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ Translation-en
Ign:10 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ all Packages
Ign:11 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ amd64 Packages
Ign:12 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ Translation-en
Ign:10 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ all Packages
Ign:11 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ amd64 Packages
Ign:12 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ Translation-en
Ign:10 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ all Packages
Ign:11 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ amd64 Packages
Ign:12 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ Translation-en
Ign:10 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ all Packages
Ign:11 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ amd64 Packages
Ign:12 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ Translation-en
Ign:10 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ all Packages
Err:11 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ amd64 Packages
403 Forbidden
Ign:12 http://download.draios.com/stable/deb yakkety/stable-$(ARCH)/ Translation-en
Fetched 103 kB in 0s (211 kB/s)
Reading package lists...
STDERR: W: The repository 'http://download.draios.com/stable/deb yakkety Release' does not have a Release file.
E: Failed to fetch http://download.draios.com/stable/deb/dists/yakkety/stable-$(ARCH)//binary-amd64/Packages 403 Forbidden
E: Some index files failed to download. They have been ignored, or old ones used instead.
---- End output of apt-get -q update ----
Ran apt-get -q update returned 100
I found that when I set the distribution property to false I get the correct /etc/apt/sources.list.d/sysdig.list file which looks like this.
deb "http://download.draios.com/stable/deb" stable-$(ARCH)/
Would you mind making your code look like this to fix the issue?
apt_repository 'sysdig' do
uri node['sysdig']['apt']['uri']
components node['sysdig']['apt']['components']
distribution false
key node['sysdig']['apt']['key']
not_if "apt-key list | grep -i #{node['sysdig']['apt']['key_id']}"
end
Full disclosure, I haven't tested what impact this would have for anyone still using the old/deprecated apt_repository resource provided by the apt cookbook.
https://github.com/jarosser06/chef-sysdig/blob/master/recipes/default.rb#L42-L47
Recent versions of Chef Client include a core apt_repository resource instead of requiring the resource that came with the apt cookbook. The new core resource calculates a default value for the
distribution
property, "yakkety" in my case, which results in a/etc/apt/sources.list.d/sysdig.list
that looks like this.This causes the subsequent
apt-get update
to fail every time.I found that when I set the distribution property to
false
I get the correct/etc/apt/sources.list.d/sysdig.list
file which looks like this.And
apt-get update
no longer fails.Would you mind making your code look like this to fix the issue?
Full disclosure, I haven't tested what impact this would have for anyone still using the old/deprecated apt_repository resource provided by the apt cookbook.
Thanks a lot!