chef-cookbooks / runit

Development repository for the Chef Runit Cookbook
https://supermarket.chef.io/cookbooks/runit
Apache License 2.0
106 stars 197 forks source link

Run `apt-get update` before installation of the package on Debian #214

Closed grv87 closed 7 years ago

grv87 commented 7 years ago

I have the following error under Ubuntu:

        * apt_package[runit] action install[2017-03-15T04:48:24+00:00] INFO: Processing apt_package[runit] action install (runit::default line 49)

           * No candidate version available for runit
           ================================================================================
           Error executing action `install` on resource 'apt_package[runit]'
           ================================================================================

           Chef::Exceptions::Package
           -------------------------
           No candidate version available for runit

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/runit/recipes/default.rb

            49:   package 'runit' do
            50:     action :install
            51:     response_file 'runit.seed'
            52:   end
            53: end

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/runit/recipes/default.rb:49:in `from_file'

           apt_package("runit") do
             package_name "runit"
             action [:install]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :package
             cookbook_name "runit"
             recipe_name "default"
             response_file "runit.seed"
           end

           Platform:
           ---------
           x86_64-linux

This PR fixes it

tas50 commented 7 years ago

Apt updates are something that need to be managed by the consumer of the cookbook themselves. We end up with multiple cookbooks each trying to do apt-updates and it's a bit of a mess. There's an apt_update resource in Chef now. I'd recommend either putting that at the very beginning of some sort of base cookbook you use in your environment, or making sure apt::default is at the beginning of your base role.

grv87 commented 7 years ago

OK, I got it. Thanks!