5 # Copyright:: 2010, Tom Hughes
 
   7 # Licensed under the Apache License, Version 2.0 (the "License");
 
   8 # you may not use this file except in compliance with the License.
 
   9 # You may obtain a copy of the License at
 
  11 #     https://www.apache.org/licenses/LICENSE-2.0
 
  13 # Unless required by applicable law or agreed to in writing, software
 
  14 # distributed under the License is distributed on an "AS IS" BASIS,
 
  15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  16 # See the License for the specific language governing permissions and
 
  17 # limitations under the License.
 
  24   update-notifier-common
 
  27 file "/etc/motd.tail" do
 
  31 template "/etc/apt/preferences.d/99-chef" do
 
  32   source "preferences.erb"
 
  38 apt_update "/etc/apt/sources.list" do
 
  43   archive_host = if node[:country]
 
  44                    "#{node[:country]}.archive.ubuntu.com"
 
  48   archive_security_host = "security.ubuntu.com"
 
  49   archive_distro = "ubuntu"
 
  51   archive_host = "ports.ubuntu.com"
 
  52   archive_security_host = archive_host
 
  53   archive_distro = "ubuntu-ports"
 
  56 template "/etc/apt/sources.list" do
 
  57   source "sources.list.erb"
 
  61   variables :archive_host => archive_host, :archive_security_host => archive_security_host, :archive_distro => archive_distro, :codename => node[:lsb][:codename]
 
  62   notifies :update, "apt_update[/etc/apt/sources.list]", :immediately
 
  65 apt_repository "openstreetmap" do
 
  66   uri "ppa:osmadmins/ppa"
 
  69 package "unattended-upgrades"
 
  71 if Dir.exist?("/usr/share/unattended-upgrades")
 
  72   auto_upgrades = if node[:apt][:unattended_upgrades][:enable]
 
  73                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades")
 
  75                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades-disabled")
 
  78   file "/etc/apt/apt.conf.d/20auto-upgrades" do
 
  86 template "/etc/apt/apt.conf.d/60chef" do