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 execute "apt-update" do
 
  33   command "/usr/bin/apt-get update"
 
  36 archive_host = if node[:country]
 
  37                  "#{node[:country]}.archive.ubuntu.com"
 
  42 template "/etc/apt/sources.list" do
 
  43   source "sources.list.erb"
 
  47   variables :archive_host => archive_host, :codename => node[:lsb][:codename]
 
  48   notifies :run, "execute[apt-update]", :immediately
 
  51 if node[:lsb][:release].to_f >= 16.04
 
  52   apt_source "brightbox-ruby-ng" do
 
  56   apt_source "brightbox-ruby-ng" do
 
  57     url "http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu"
 
  58     key "F5DA5F09C3173AA6"
 
  62 apt_source "ubuntugis-stable" do
 
  63   url "http://ppa.launchpad.net/ubuntugis/ppa/ubuntu"
 
  64   key "089EBE08314DF160"
 
  67 apt_source "ubuntugis-unstable" do
 
  68   url "http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu"
 
  69   key "089EBE08314DF160"
 
  72 apt_source "openstreetmap" do
 
  73   url "http://ppa.launchpad.net/osmadmins/ppa/ubuntu"
 
  74   key "D57F48750AC4F2CB"
 
  78 apt_source "management-component-pack" do
 
  79   source_template "hp.list.erb"
 
  80   url "https://downloads.linux.hpe.com/SDR/repo/mcp"
 
  81   key "C208ADDE26C2B797"
 
  82   key_url "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub"
 
  85 apt_source "hwraid" do
 
  86   source_template "hwraid.list.erb"
 
  87   url "https://hwraid.le-vert.net/ubuntu"
 
  88   key "6005210E23B3D3B4"
 
  91 apt_source "mapnik-v210" do
 
  92   url "http://ppa.launchpad.net/mapnik/v2.1.0/ubuntu"
 
  93   key "4F7B93595D50B6BA"
 
  97   source_template "nginx.list.erb"
 
  98   url "https://nginx.org/packages/ubuntu"
 
  99   key "ABF5BD827BD9BF62"
 
 102 apt_source "elasticsearch1.7" do
 
 103   source_template "elasticsearch.list.erb"
 
 104   url "https://packages.elasticsearch.org/elasticsearch/1.7/debian"
 
 105   key "D27D666CD88E42B4"
 
 108 apt_source "elasticsearch2.x" do
 
 109   source_template "elasticsearch.list.erb"
 
 110   url "https://packages.elasticsearch.org/elasticsearch/2.x/debian"
 
 111   key "D27D666CD88E42B4"
 
 114 apt_source "elasticsearch5.x" do
 
 115   source_template "elasticsearch.list.erb"
 
 116   url "https://artifacts.elastic.co/packages/5.x/apt"
 
 117   key "D27D666CD88E42B4"
 
 120 apt_source "logstash" do
 
 121   source_template "elasticsearch.list.erb"
 
 122   url "https://packages.elasticsearch.org/logstash/2.3/debian"
 
 123   key "D27D666CD88E42B4"
 
 126 apt_source "logstash-forwarder" do
 
 127   source_template "elasticsearch.list.erb"
 
 128   url "https://packages.elasticsearch.org/logstashforwarder/debian"
 
 129   key "D27D666CD88E42B4"
 
 132 apt_source "passenger" do
 
 133   url "https://oss-binaries.phusionpassenger.com/apt/passenger"
 
 134   key "561F9B9CAC40B2F7"
 
 137 apt_source "postgresql" do
 
 138   source_template "postgresql.list.erb"
 
 139   url "https://apt.postgresql.org/pub/repos/apt"
 
 140   key "7FCC7D46ACCC4CF8"
 
 143 apt_source "mediawiki" do
 
 144   source_template "mediawiki.list.erb"
 
 145   url "https://releases.wikimedia.org/debian"
 
 146   key "90E9F83F22250DD7"
 
 149 package "unattended-upgrades"
 
 151 if Dir.exist?("/usr/share/unattended-upgrades")
 
 152   auto_upgrades = if node[:apt][:unattended_upgrades][:enable]
 
 153                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades")
 
 155                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades-disabled")
 
 158   file "/etc/apt/apt.conf.d/20auto-upgrades" do
 
 162     content auto_upgrades
 
 166 template "/etc/apt/apt.conf.d/60chef" do
 
 167   source "apt.conf.erb"