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.
22 package "update-notifier-common"
24 file "/etc/motd.tail" do
28 execute "apt-update" do
30 command "/usr/bin/apt-get update"
33 archive_host = if node[:country]
34 "#{node[:country]}.archive.ubuntu.com"
39 template "/etc/apt/sources.list" do
40 source "sources.list.erb"
44 variables :archive_host => archive_host, :codename => node[:lsb][:codename]
45 notifies :run, "execute[apt-update]", :immediately
48 if node[:lsb][:release].to_f >= 16.04
49 apt_source "brightbox-ruby-ng" do
53 apt_source "brightbox-ruby-ng" do
54 url "http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu"
55 key "F5DA5F09C3173AA6"
59 apt_source "ubuntugis-stable" do
60 url "http://ppa.launchpad.net/ubuntugis/ppa/ubuntu"
61 key "089EBE08314DF160"
64 apt_source "ubuntugis-unstable" do
65 url "http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu"
66 key "3089EBE08314DF160"
69 apt_source "openstreetmap" do
70 url "http://ppa.launchpad.net/osmadmins/ppa/ubuntu"
71 key "D57F48750AC4F2CB"
74 apt_source "management-component-pack" do
75 template "hp.list.erb"
76 url "http://downloads.linux.hpe.com/SDR/repo/mcp"
77 key "C208ADDE26C2B797"
78 key_url "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub"
81 apt_source "hwraid" do
82 template "hwraid.list.erb"
83 url "http://hwraid.le-vert.net/ubuntu"
84 key "6005210E23B3D3B4"
87 apt_source "mapnik-v210" do
88 url "http://ppa.launchpad.net/mapnik/v2.1.0/ubuntu"
89 key "4F7B93595D50B6BA"
93 template "nginx.list.erb"
94 url "http://nginx.org/packages/ubuntu"
95 key "ABF5BD827BD9BF62"
98 apt_source "elasticsearch" do
99 template "elasticsearch.list.erb"
100 url "http://packages.elasticsearch.org/elasticsearch/1.7/debian"
101 key "D27D666CD88E42B4"
104 apt_source "logstash" do
105 template "elasticsearch.list.erb"
106 url "http://packages.elasticsearch.org/logstash/2.3/debian"
107 key "D27D666CD88E42B4"
110 apt_source "logstash-forwarder" do
111 template "elasticsearch.list.erb"
112 url "http://packages.elasticsearch.org/logstashforwarder/debian"
113 key "D27D666CD88E42B4"
116 apt_source "passenger" do
117 url "https://oss-binaries.phusionpassenger.com/apt/passenger"
118 key "561F9B9CAC40B2F7"
121 apt_source "postgresql" do
122 template "postgresql.list.erb"
123 url "http://apt.postgresql.org/pub/repos/apt"
124 key "7FCC7D46ACCC4CF8"
127 apt_source "mediawiki" do
128 template "mediawiki.list.erb"
129 url "https://releases.wikimedia.org/debian"
130 key "90E9F83F22250DD7"
133 package "unattended-upgrades"
135 if Dir.exist?("/usr/share/unattended-upgrades")
136 auto_upgrades = if node[:apt][:unattended_upgrades][:enable]
137 IO.read("/usr/share/unattended-upgrades/20auto-upgrades")
139 IO.read("/usr/share/unattended-upgrades/20auto-upgrades-disabled")
142 file "/etc/apt/apt.conf.d/20auto-upgrades" do
146 content auto_upgrades
150 template "/etc/apt/apt.conf.d/60chef" do
151 source "apt.conf.erb"