]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/apt/definitions/apt_source.rb
Reduce the cutoff time when looking for tiles to expire
[chef.git] / cookbooks / apt / definitions / apt_source.rb
index c109707a9cbb6ae8cff6f04c95625365db83b7ba..f98b2b22c55a0188448ecc919ca1c4f1d2595e1d 100644 (file)
@@ -21,9 +21,11 @@ define :apt_source do
   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