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.
 
  23   update-notifier-common
 
  26 file "/etc/motd.tail" do
 
  30 execute "apt-update" do
 
  32   command "/usr/bin/apt-get update"
 
  35 archive_host = if node[:country]
 
  36                  "#{node[:country]}.archive.ubuntu.com"
 
  41 template "/etc/apt/sources.list" do
 
  42   source "sources.list.erb"
 
  46   variables :archive_host => archive_host, :codename => node[:lsb][:codename]
 
  47   notifies :run, "execute[apt-update]", :immediately
 
  50 if node[:lsb][:release].to_f >= 16.04
 
  51   apt_source "brightbox-ruby-ng" do
 
  55   apt_source "brightbox-ruby-ng" do
 
  56     url "http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu"
 
  57     key "F5DA5F09C3173AA6"
 
  61 apt_source "ubuntugis-stable" do
 
  62   url "http://ppa.launchpad.net/ubuntugis/ppa/ubuntu"
 
  63   key "089EBE08314DF160"
 
  66 apt_source "ubuntugis-unstable" do
 
  67   url "http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu"
 
  68   key "089EBE08314DF160"
 
  71 apt_source "openstreetmap" do
 
  72   url "http://ppa.launchpad.net/osmadmins/ppa/ubuntu"
 
  73   key "D57F48750AC4F2CB"
 
  77 apt_source "management-component-pack" do
 
  78   source_template "hp.list.erb"
 
  79   url "http://downloads.linux.hpe.com/SDR/repo/mcp"
 
  80   key "C208ADDE26C2B797"
 
  81   key_url "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub"
 
  84 apt_source "hwraid" do
 
  85   source_template "hwraid.list.erb"
 
  86   url "http://hwraid.le-vert.net/ubuntu"
 
  87   key "6005210E23B3D3B4"
 
  90 apt_source "mapnik-v210" do
 
  91   url "http://ppa.launchpad.net/mapnik/v2.1.0/ubuntu"
 
  92   key "4F7B93595D50B6BA"
 
  96   source_template "nginx.list.erb"
 
  97   url "http://nginx.org/packages/ubuntu"
 
  98   key "ABF5BD827BD9BF62"
 
 101 apt_source "elasticsearch1.7" do
 
 102   source_template "elasticsearch.list.erb"
 
 103   url "http://packages.elasticsearch.org/elasticsearch/1.7/debian"
 
 104   key "D27D666CD88E42B4"
 
 107 apt_source "elasticsearch2.x" do
 
 108   source_template "elasticsearch.list.erb"
 
 109   url "http://packages.elasticsearch.org/elasticsearch/2.x/debian"
 
 110   key "D27D666CD88E42B4"
 
 113 apt_source "elasticsearch5.x" do
 
 114   source_template "elasticsearch.list.erb"
 
 115   url "https://artifacts.elastic.co/packages/5.x/apt"
 
 116   key "D27D666CD88E42B4"
 
 119 apt_source "logstash" do
 
 120   source_template "elasticsearch.list.erb"
 
 121   url "http://packages.elasticsearch.org/logstash/2.3/debian"
 
 122   key "D27D666CD88E42B4"
 
 125 apt_source "logstash-forwarder" do
 
 126   source_template "elasticsearch.list.erb"
 
 127   url "http://packages.elasticsearch.org/logstashforwarder/debian"
 
 128   key "D27D666CD88E42B4"
 
 131 apt_source "passenger" do
 
 132   url "https://oss-binaries.phusionpassenger.com/apt/passenger"
 
 133   key "561F9B9CAC40B2F7"
 
 136 apt_source "postgresql" do
 
 137   source_template "postgresql.list.erb"
 
 138   url "http://apt.postgresql.org/pub/repos/apt"
 
 139   key "7FCC7D46ACCC4CF8"
 
 142 apt_source "mediawiki" do
 
 143   source_template "mediawiki.list.erb"
 
 144   url "https://releases.wikimedia.org/debian"
 
 145   key "90E9F83F22250DD7"
 
 148 package "unattended-upgrades"
 
 150 if Dir.exist?("/usr/share/unattended-upgrades")
 
 151   auto_upgrades = if node[:apt][:unattended_upgrades][:enable]
 
 152                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades")
 
 154                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades-disabled")
 
 157   file "/etc/apt/apt.conf.d/20auto-upgrades" do
 
 161     content auto_upgrades
 
 165 template "/etc/apt/apt.conf.d/60chef" do
 
 166   source "apt.conf.erb"