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 #     http://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.
 
  21 package "update-notifier-common"
 
  23 file "/etc/motd.tail" do
 
  27 execute "apt-update" do
 
  29   command "/usr/bin/apt-get update"
 
  32 archive_host = if node[:country]
 
  33                  "#{node[:country]}.archive.ubuntu.com"
 
  38 template "/etc/apt/sources.list" do
 
  39   source "sources.list.erb"
 
  43   variables :archive_host => archive_host, :codename => node[:lsb][:codename]
 
  44   notifies :run, "execute[apt-update]", :immediately
 
  47 if node[:lsb][:release].to_f >= 16.04
 
  48   apt_source "brightbox-ruby-ng" do
 
  52   apt_source "brightbox-ruby-ng" do
 
  53     url "http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu"
 
  58 apt_source "ubuntugis-stable" do
 
  59   url "http://ppa.launchpad.net/ubuntugis/ppa/ubuntu"
 
  63 apt_source "ubuntugis-unstable" do
 
  64   url "http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu"
 
  68 apt_source "openstreetmap" do
 
  69   url "http://ppa.launchpad.net/osmadmins/ppa/ubuntu"
 
  73 apt_source "management-component-pack" do
 
  74   template "hp.list.erb"
 
  75   url "http://downloads.linux.hpe.com/SDR/repo/mcp"
 
  79 apt_source "hwraid" do
 
  80   template "hwraid.list.erb"
 
  81   url "http://hwraid.le-vert.net/ubuntu"
 
  85 apt_source "mapnik-v210" do
 
  86   url "http://ppa.launchpad.net/mapnik/v2.1.0/ubuntu"
 
  91   template "nginx.list.erb"
 
  92   url "http://nginx.org/packages/ubuntu"
 
  96 apt_source "elasticsearch" do
 
  97   template "elasticsearch.list.erb"
 
  98   url "http://packages.elasticsearch.org/elasticsearch/1.7/debian"
 
 102 apt_source "logstash" do
 
 103   template "elasticsearch.list.erb"
 
 104   url "http://packages.elasticsearch.org/logstash/2.3/debian"
 
 108 apt_source "logstash-forwarder" do
 
 109   template "elasticsearch.list.erb"
 
 110   url "http://packages.elasticsearch.org/logstashforwarder/debian"
 
 114 apt_source "passenger" do
 
 115   url "https://oss-binaries.phusionpassenger.com/apt/passenger"
 
 119 apt_source "postgresql" do
 
 120   template "postgresql.list.erb"
 
 121   url "http://apt.postgresql.org/pub/repos/apt"
 
 125 apt_source "mediawiki" do
 
 126   template "mediawiki.list.erb"
 
 127   url "https://releases.wikimedia.org/debian"
 
 128   key "664C383A3566A3481B942F007A322AC6E84AFDD2"
 
 131 package "unattended-upgrades"
 
 133 if Dir.exist?("/usr/share/unattended-upgrades")
 
 134   auto_upgrades = if node[:apt][:unattended_upgrades][:enable]
 
 135                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades")
 
 137                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades-disabled")
 
 140   file "/etc/apt/apt.conf.d/20auto-upgrades" do
 
 144     content auto_upgrades
 
 148 template "/etc/apt/apt.conf.d/60chef" do
 
 149   source "apt.conf.erb"