X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/805ab61e66fe3adb45e57f50e49b168d84a6a8b1..bd08729fe0c15a4769332a352cc3723dee13aa24:/cookbooks/apt/definitions/apt_source.rb diff --git a/cookbooks/apt/definitions/apt_source.rb b/cookbooks/apt/definitions/apt_source.rb index c109707a9..cc847a01e 100644 --- a/cookbooks/apt/definitions/apt_source.rb +++ b/cookbooks/apt/definitions/apt_source.rb @@ -18,12 +18,14 @@ # define :apt_source do - if node.apt.sources.include?(params[:name]) + if node[:apt][:sources].include?(params[:name]) source_action = :create - execute "apt-key-#{params[:key]}" do - command "/usr/bin/apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys #{params[:key]}" - not_if "/usr/bin/apt-key list | /bin/fgrep -q #{params[:key]}" + if params[:key] + execute "apt-key-#{params[:key]}" do + command "/usr/bin/apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys #{params[:key]}" + not_if "/usr/bin/apt-key list | /bin/fgrep -q #{params[:key]}" + end end else source_action = :delete @@ -35,7 +37,7 @@ define :apt_source do owner "root" group "root" mode 0644 - notifies :run, resources(:execute => "apt-update") + notifies :run, "execute[apt-update]" variables :url => params[:url] end end