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.
23 update-notifier-common
26 file "/etc/motd.tail" do
30 apt_update "/etc/apt/sources.list" do
34 archive_host = if node[:country]
35 "#{node[:country]}.archive.ubuntu.com"
40 template "/etc/apt/sources.list" do
41 source "sources.list.erb"
45 variables :archive_host => archive_host, :codename => node[:lsb][:codename]
46 notifies :update, "apt_update[/etc/apt/sources.list]", :immediately
49 repository_actions = Hash.new do |_, repository|
50 node[:apt][:sources].include?(repository) ? :add : :remove
53 apt_repository "brightbox-ruby-ng" do
54 action repository_actions["brightbox-ruby-ng"]
55 uri "ppa:brightbox/ruby-ng"
58 apt_repository "ubuntugis-stable" do
59 action repository_actions["ubuntugis-stable"]
60 uri "ppa:ubuntugis/ppa"
63 apt_repository "ubuntugis-unstable" do
64 action repository_actions["ubuntugis-unstable"]
65 uri "ppa:ubuntugis/ubuntugis-unstable"
68 apt_repository "openstreetmap" do
69 action repository_actions["openstreetmap"]
70 uri "ppa:osmadmins/ppa"
73 apt_repository "squid2" do
74 action repository_actions["squid2"]
75 uri "ppa:osmadmins/squid2"
78 apt_repository "squid3" do
79 action repository_actions["squid3"]
80 uri "ppa:osmadmins/squid3"
83 apt_repository "management-component-pack" do
84 action repository_actions["management-component-pack"]
85 uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
86 distribution "#{node[:lsb][:codename]}/current"
87 components ["non-free"]
88 key "C208ADDE26C2B797"
91 apt_repository "hwraid" do
92 action repository_actions["hwraid"]
93 uri "https://hwraid.le-vert.net/ubuntu"
94 distribution "precise"
96 key "6005210E23B3D3B4"
99 apt_repository "nginx" do
100 action repository_actions["nginx"]
101 uri "https://nginx.org/packages/ubuntu"
103 key "ABF5BD827BD9BF62"
106 apt_repository "elasticsearch5.x" do
107 action repository_actions["elasticsearch5.x"]
108 uri "https://artifacts.elastic.co/packages/5.x/apt"
109 distribution "stable"
111 key "D27D666CD88E42B4"
114 apt_repository "elasticsearch6.x" do
115 action repository_actions["elasticsearch6.x"]
116 uri "https://artifacts.elastic.co/packages/6.x/apt"
117 distribution "stable"
119 key "D27D666CD88E42B4"
122 apt_repository "passenger" do
123 action repository_actions["passenger"]
124 uri "https://oss-binaries.phusionpassenger.com/apt/passenger"
126 key "561F9B9CAC40B2F7"
129 apt_repository "postgresql" do
130 action repository_actions["postgresql"]
131 uri "https://apt.postgresql.org/pub/repos/apt"
132 distribution "#{node[:lsb][:codename]}-pgdg"
134 key "7FCC7D46ACCC4CF8"
137 apt_repository "mediawiki" do
138 action repository_actions["mediawiki"]
139 uri "https://releases.wikimedia.org/debian"
140 distribution "jessie-mediawiki"
142 key "90E9F83F22250DD7"
145 package "unattended-upgrades"
147 if Dir.exist?("/usr/share/unattended-upgrades")
148 auto_upgrades = if node[:apt][:unattended_upgrades][:enable]
149 IO.read("/usr/share/unattended-upgrades/20auto-upgrades")
151 IO.read("/usr/share/unattended-upgrades/20auto-upgrades-disabled")
154 file "/etc/apt/apt.conf.d/20auto-upgrades" do
158 content auto_upgrades
162 template "/etc/apt/apt.conf.d/60chef" do
163 source "apt.conf.erb"