]> git.openstreetmap.org Git - chef.git/blob - cookbooks/apt/recipes/default.rb
Drop unused brightbox-ruby-ng repository from ridley
[chef.git] / cookbooks / apt / recipes / default.rb
1 #
2 # Cookbook Name:: apt
3 # Recipe:: default
4 #
5 # Copyright 2010, Tom Hughes
6 #
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
10 #
11 #     https://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19
20 package %w[
21   apt
22   apt-transport-https
23   update-notifier-common
24 ]
25
26 if node[:lsb][:release].to_f < 18.04
27   package "gnupg-curl"
28 end
29
30 file "/etc/motd.tail" do
31   action :delete
32 end
33
34 execute "apt-update" do
35   action :nothing
36   command "/usr/bin/apt-get update"
37 end
38
39 archive_host = if node[:country]
40                  "#{node[:country]}.archive.ubuntu.com"
41                else
42                  "archive.ubuntu.com"
43                end
44
45 template "/etc/apt/sources.list" do
46   source "sources.list.erb"
47   owner "root"
48   group "root"
49   mode 0o644
50   variables :archive_host => archive_host, :codename => node[:lsb][:codename]
51   notifies :run, "execute[apt-update]", :immediately
52 end
53
54 if node[:lsb][:release].to_f >= 16.04
55   apt_source "brightbox-ruby-ng" do
56     action :delete
57   end
58 else
59   apt_source "brightbox-ruby-ng" do
60     url "http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu"
61     key "F5DA5F09C3173AA6"
62   end
63 end
64
65 apt_source "ubuntugis-stable" do
66   url "http://ppa.launchpad.net/ubuntugis/ppa/ubuntu"
67   key "089EBE08314DF160"
68 end
69
70 apt_source "ubuntugis-unstable" do
71   url "http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu"
72   key "089EBE08314DF160"
73 end
74
75 apt_source "openstreetmap" do
76   url "http://ppa.launchpad.net/osmadmins/ppa/ubuntu"
77   key "D57F48750AC4F2CB"
78   update true
79 end
80
81 apt_source "squid2" do
82   url "http://ppa.launchpad.net/osmadmins/squid2/ubuntu"
83   key "D57F48750AC4F2CB"
84   update true
85 end
86
87 apt_source "squid3" do
88   url "http://ppa.launchpad.net/osmadmins/squid3/ubuntu"
89   key "D57F48750AC4F2CB"
90   update true
91 end
92
93 apt_source "management-component-pack" do
94   source_template "hp.list.erb"
95   url "https://downloads.linux.hpe.com/SDR/repo/mcp"
96   key "C208ADDE26C2B797"
97   key_url "https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub"
98 end
99
100 apt_source "hwraid" do
101   source_template "hwraid.list.erb"
102   url "https://hwraid.le-vert.net/ubuntu"
103   key "6005210E23B3D3B4"
104 end
105
106 apt_source "mapnik-v210" do
107   url "http://ppa.launchpad.net/mapnik/v2.1.0/ubuntu"
108   key "4F7B93595D50B6BA"
109 end
110
111 apt_source "nginx" do
112   source_template "nginx.list.erb"
113   url "https://nginx.org/packages/ubuntu"
114   key "ABF5BD827BD9BF62"
115 end
116
117 apt_source "elasticsearch1.7" do
118   source_template "elasticsearch.list.erb"
119   url "https://packages.elasticsearch.org/elasticsearch/1.7/debian"
120   key "D27D666CD88E42B4"
121 end
122
123 apt_source "elasticsearch2.x" do
124   source_template "elasticsearch.list.erb"
125   url "https://packages.elasticsearch.org/elasticsearch/2.x/debian"
126   key "D27D666CD88E42B4"
127 end
128
129 apt_source "elasticsearch5.x" do
130   source_template "elasticsearch.list.erb"
131   url "https://artifacts.elastic.co/packages/5.x/apt"
132   key "D27D666CD88E42B4"
133 end
134
135 apt_source "logstash" do
136   source_template "elasticsearch.list.erb"
137   url "https://packages.elasticsearch.org/logstash/2.3/debian"
138   key "D27D666CD88E42B4"
139 end
140
141 apt_source "passenger" do
142   url "https://oss-binaries.phusionpassenger.com/apt/passenger"
143   key "561F9B9CAC40B2F7"
144 end
145
146 apt_source "postgresql" do
147   source_template "postgresql.list.erb"
148   url "https://apt.postgresql.org/pub/repos/apt"
149   key "7FCC7D46ACCC4CF8"
150 end
151
152 apt_source "mediawiki" do
153   source_template "mediawiki.list.erb"
154   url "https://releases.wikimedia.org/debian"
155   key "90E9F83F22250DD7"
156 end
157
158 package "unattended-upgrades"
159
160 if Dir.exist?("/usr/share/unattended-upgrades")
161   auto_upgrades = if node[:apt][:unattended_upgrades][:enable]
162                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades")
163                   else
164                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades-disabled")
165                   end
166
167   file "/etc/apt/apt.conf.d/20auto-upgrades" do
168     user "root"
169     group "root"
170     mode 0o644
171     content auto_upgrades
172   end
173 end
174
175 template "/etc/apt/apt.conf.d/60chef" do
176   source "apt.conf.erb"
177   owner "root"
178   group "root"
179   mode 0o644
180 end