]> git.openstreetmap.org Git - chef.git/blob - cookbooks/apt/recipes/default.rb
nominatim: fix rights for restricted IP log
[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 #     http://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   gnupg-curl
23   update-notifier-common
24 ]
25
26 file "/etc/motd.tail" do
27   action :delete
28 end
29
30 execute "apt-update" do
31   action :nothing
32   command "/usr/bin/apt-get update"
33 end
34
35 archive_host = if node[:country]
36                  "#{node[:country]}.archive.ubuntu.com"
37                else
38                  "archive.ubuntu.com"
39                end
40
41 template "/etc/apt/sources.list" do
42   source "sources.list.erb"
43   owner "root"
44   group "root"
45   mode 0o644
46   variables :archive_host => archive_host, :codename => node[:lsb][:codename]
47   notifies :run, "execute[apt-update]", :immediately
48 end
49
50 if node[:lsb][:release].to_f >= 16.04
51   apt_source "brightbox-ruby-ng" do
52     action :delete
53   end
54 else
55   apt_source "brightbox-ruby-ng" do
56     url "http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu"
57     key "F5DA5F09C3173AA6"
58   end
59 end
60
61 apt_source "ubuntugis-stable" do
62   url "http://ppa.launchpad.net/ubuntugis/ppa/ubuntu"
63   key "089EBE08314DF160"
64 end
65
66 apt_source "ubuntugis-unstable" do
67   url "http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu"
68   key "089EBE08314DF160"
69 end
70
71 apt_source "openstreetmap" do
72   url "http://ppa.launchpad.net/osmadmins/ppa/ubuntu"
73   key "D57F48750AC4F2CB"
74   update true
75 end
76
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"
82 end
83
84 apt_source "hwraid" do
85   source_template "hwraid.list.erb"
86   url "http://hwraid.le-vert.net/ubuntu"
87   key "6005210E23B3D3B4"
88 end
89
90 apt_source "mapnik-v210" do
91   url "http://ppa.launchpad.net/mapnik/v2.1.0/ubuntu"
92   key "4F7B93595D50B6BA"
93 end
94
95 apt_source "nginx" do
96   source_template "nginx.list.erb"
97   url "http://nginx.org/packages/ubuntu"
98   key "ABF5BD827BD9BF62"
99 end
100
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"
105 end
106
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"
111 end
112
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"
117 end
118
119 apt_source "logstash" do
120   source_template "elasticsearch.list.erb"
121   url "http://packages.elasticsearch.org/logstash/2.3/debian"
122   key "D27D666CD88E42B4"
123 end
124
125 apt_source "logstash-forwarder" do
126   source_template "elasticsearch.list.erb"
127   url "http://packages.elasticsearch.org/logstashforwarder/debian"
128   key "D27D666CD88E42B4"
129 end
130
131 apt_source "passenger" do
132   url "https://oss-binaries.phusionpassenger.com/apt/passenger"
133   key "561F9B9CAC40B2F7"
134 end
135
136 apt_source "postgresql" do
137   source_template "postgresql.list.erb"
138   url "http://apt.postgresql.org/pub/repos/apt"
139   key "7FCC7D46ACCC4CF8"
140 end
141
142 apt_source "mediawiki" do
143   source_template "mediawiki.list.erb"
144   url "https://releases.wikimedia.org/debian"
145   key "90E9F83F22250DD7"
146 end
147
148 package "unattended-upgrades"
149
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")
153                   else
154                     IO.read("/usr/share/unattended-upgrades/20auto-upgrades-disabled")
155                   end
156
157   file "/etc/apt/apt.conf.d/20auto-upgrades" do
158     user "root"
159     group "root"
160     mode 0o644
161     content auto_upgrades
162   end
163 end
164
165 template "/etc/apt/apt.conf.d/60chef" do
166   source "apt.conf.erb"
167   owner "root"
168   group "root"
169   mode 0o644
170 end