sous-chefs / apt

Development repository for the apt cookbook
https://supermarket.chef.io/cookbooks/apt
Apache License 2.0
202 stars 266 forks source link

Add ability to control `ignore_failure` for a specific `apt_repository` LWRP use #183

Closed winhamwr closed 7 years ago

winhamwr commented 8 years ago

Environment:

Debian

Scenario:

If some of your apt_repository 'foo' do blocks are critical (any failure should fail the entire run), but others are non-critical (OK to ignore), you have to choose to either fail when you don't need to or continue when you wanted to fail.

Steps to Reproduce:

apt_repository 'juju' do
  uri 'http://ppa.launchpad.net/juju/stable/ubuntu'
  components ['main']
  distribution 'trusty'
  key 'C8068B11'
  keyserver 'keyserver.ubuntu.com'
  action :add
  deb_src true
  ignore_failure true
end

apt_repository 'cloudera' do
  uri          'http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh'
  arch         'amd64'
  distribution 'precise-cdh4'
  components   ['contrib']
  key          'http://archive.cloudera.com/debian/archive.key'
  ignore_failure false
end

Expected Result:

A failure to add the juju repo shouldn't fail the build, while a failure to add the cloudera repo should.

winhamwr commented 8 years ago

This is related to the request for retry logic in #164, but I think they're distinct issues. There are reasons other than retry-fixable intermittent failures to have different ignore_failure behavior on different repositories.

tas50 commented 7 years ago

We've removed the apt_update and apt_repository resources from this cookbook as they were merged into core chef. I'm going to close this issue out now. If you think it's still valid against a new chef-client release please open it up against the chef/chef repo so we can work on it where the code now resides.