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