]> git.openstreetmap.org Git - chef.git/commitdiff
Rework apt repository configuration
authorTom Hughes <tom@compton.nu>
Thu, 22 Sep 2022 22:07:58 +0000 (23:07 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 23 Sep 2022 07:36:42 +0000 (08:36 +0100)
Instead of using attributes to turn repositories on, use a
separate recipe for each optional repository that is included
by those things which need it.

42 files changed:
.kitchen.yml
cookbooks/apt/attributes/default.rb
cookbooks/apt/recipes/default.rb
cookbooks/apt/recipes/docker.rb [new file with mode: 0644]
cookbooks/apt/recipes/elasticsearch6.rb [new file with mode: 0644]
cookbooks/apt/recipes/elasticsearch8.rb [new file with mode: 0644]
cookbooks/apt/recipes/git-core.rb [new file with mode: 0644]
cookbooks/apt/recipes/grafana.rb [new file with mode: 0644]
cookbooks/apt/recipes/hwraid.rb [new file with mode: 0644]
cookbooks/apt/recipes/management-component-pack.rb [new file with mode: 0644]
cookbooks/apt/recipes/maxmind.rb [new file with mode: 0644]
cookbooks/apt/recipes/nginx.rb [new file with mode: 0644]
cookbooks/apt/recipes/passenger.rb [new file with mode: 0644]
cookbooks/apt/recipes/postgresql.rb [new file with mode: 0644]
cookbooks/apt/recipes/timescaledb.rb [new file with mode: 0644]
cookbooks/apt/recipes/ubuntugis-stable.rb [new file with mode: 0644]
cookbooks/apt/recipes/ubuntugis-unstable.rb [new file with mode: 0644]
cookbooks/chef/attributes/default.rb
cookbooks/docker/attributes/default.rb [deleted file]
cookbooks/docker/recipes/default.rb
cookbooks/elasticsearch/attributes/default.rb
cookbooks/elasticsearch/recipes/default.rb
cookbooks/geoipupdate/attributes/default.rb
cookbooks/geoipupdate/recipes/default.rb
cookbooks/git/attributes/default.rb
cookbooks/git/recipes/default.rb
cookbooks/hardware/attributes/default.rb
cookbooks/hardware/recipes/default.rb
cookbooks/logstash/recipes/forwarder.rb
cookbooks/nginx/attributes/default.rb
cookbooks/nginx/recipes/default.rb
cookbooks/passenger/attributes/default.rb
cookbooks/passenger/recipes/default.rb
cookbooks/postgresql/attributes/default.rb
cookbooks/postgresql/recipes/default.rb
cookbooks/prometheus/attributes/default.rb
cookbooks/prometheus/recipes/server.rb
cookbooks/timescaledb/attributes/default.rb
cookbooks/timescaledb/recipes/default.rb
roles/foundation.rb
roles/ironbelly.rb
roles/logstash-forwarder.rb

index 88d2e6ca2546083491884becc039e834b3eae51a..a54f1f29de328f7b389652e216879ddeb53294f6 100644 (file)
@@ -164,10 +164,6 @@ suites:
   - name: letsencrypt
     run_list:
       - recipe[letsencrypt::default]
-    attributes:
-      apt:
-        sources:
-          - openstreetmap
   - name: logstash
     run_list:
       - recipe[logstash::default]
@@ -175,9 +171,6 @@ suites:
     run_list:
       - recipe[logstash::forwarder]
     attributes:
-      apt:
-        sources:
-          - elasticsearch8.x
       logstash:
         forwarder:
           filebeat.inputs:
index a949a1c0251300c0cac336057158cb5fffb76814..6ec384b5d7e90c2a42f12f2516794325d4dd4e8a 100644 (file)
@@ -1,3 +1,2 @@
-default[:apt][:sources] = [ "openstreetmap" ]
 default[:apt][:unattended_upgrades][:enable] = true
 default[:apt][:unattended_upgrades][:remove_unused_dependencies] = true
index fc5341ec54456e660c2aac8e28eb7ad2de884a3e..1d73a4d9bb17812afe933897cd6e2ec7cae8279d 100644 (file)
@@ -62,113 +62,10 @@ template "/etc/apt/sources.list" do
   notifies :update, "apt_update[/etc/apt/sources.list]", :immediately
 end
 
-repository_actions = Hash.new do |_, repository|
-  node[:apt][:sources].include?(repository) ? :add : :remove
-end
-
-apt_repository "ubuntugis-stable" do
-  action repository_actions["ubuntugis-stable"]
-  uri "ppa:ubuntugis/ppa"
-end
-
-apt_repository "ubuntugis-unstable" do
-  action repository_actions["ubuntugis-unstable"]
-  uri "ppa:ubuntugis/ubuntugis-unstable"
-end
-
-apt_repository "git-core" do
-  action repository_actions["git-core"]
-  uri "ppa:git-core/ppa"
-end
-
-apt_repository "maxmind" do
-  action repository_actions["maxmind"]
-  uri "ppa:maxmind/ppa"
-end
-
 apt_repository "openstreetmap" do
-  action repository_actions["openstreetmap"]
   uri "ppa:osmadmins/ppa"
 end
 
-apt_repository "management-component-pack" do
-  action repository_actions["management-component-pack"]
-  uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
-  distribution "bionic/current-gen9"
-  components ["non-free"]
-  key "C208ADDE26C2B797"
-end
-
-apt_repository "hwraid" do
-  action repository_actions["hwraid"]
-  uri "https://hwraid.le-vert.net/ubuntu"
-  distribution "precise"
-  components ["main"]
-  key "6005210E23B3D3B4"
-end
-
-apt_repository "nginx" do
-  action repository_actions["nginx"]
-  arch "amd64"
-  uri "https://nginx.org/packages/ubuntu"
-  components ["nginx"]
-  key "ABF5BD827BD9BF62"
-end
-
-apt_repository "elasticsearch6.x" do
-  action repository_actions["elasticsearch6.x"]
-  uri "https://artifacts.elastic.co/packages/6.x/apt"
-  distribution "stable"
-  components ["main"]
-  key "D27D666CD88E42B4"
-end
-
-apt_repository "elasticsearch8.x" do
-  action repository_actions["elasticsearch8.x"]
-  uri "https://artifacts.elastic.co/packages/8.x/apt"
-  distribution "stable"
-  components ["main"]
-  key "D27D666CD88E42B4"
-end
-
-apt_repository "passenger" do
-  action repository_actions["passenger"]
-  uri "https://oss-binaries.phusionpassenger.com/apt/passenger"
-  components ["main"]
-  key "561F9B9CAC40B2F7"
-end
-
-apt_repository "postgresql" do
-  action repository_actions["postgresql"]
-  uri "https://apt.postgresql.org/pub/repos/apt"
-  distribution "#{node[:lsb][:codename]}-pgdg"
-  components ["main"]
-  key "7FCC7D46ACCC4CF8"
-end
-
-apt_repository "docker" do
-  action repository_actions["docker"]
-  uri "https://download.docker.com/linux/ubuntu"
-  arch "amd64"
-  components ["stable"]
-  key "https://download.docker.com/linux/ubuntu/gpg"
-end
-
-apt_repository "grafana" do
-  action repository_actions["grafana"]
-  uri "https://packages.grafana.com/enterprise/deb"
-  distribution "stable"
-  components ["main"]
-  key "https://packages.grafana.com/gpg.key"
-end
-
-apt_repository "timescaledb" do
-  action repository_actions["timescaledb"]
-  uri "https://packagecloud.io/timescale/timescaledb/ubuntu"
-  components ["main"]
-  key "https://packagecloud.io/timescale/timescaledb/gpgkey"
-end
-
 package "unattended-upgrades"
 
 if Dir.exist?("/usr/share/unattended-upgrades")
diff --git a/cookbooks/apt/recipes/docker.rb b/cookbooks/apt/recipes/docker.rb
new file mode 100644 (file)
index 0000000..f28c15b
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: docker
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "docker" do
+  uri "https://download.docker.com/linux/ubuntu"
+  arch "amd64"
+  components ["stable"]
+  key "https://download.docker.com/linux/ubuntu/gpg"
+end
diff --git a/cookbooks/apt/recipes/elasticsearch6.rb b/cookbooks/apt/recipes/elasticsearch6.rb
new file mode 100644 (file)
index 0000000..74c02a3
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: elasticsearch6
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "elasticsearch6.x" do
+  uri "https://artifacts.elastic.co/packages/6.x/apt"
+  distribution "stable"
+  components ["main"]
+  key "D27D666CD88E42B4"
+end
diff --git a/cookbooks/apt/recipes/elasticsearch8.rb b/cookbooks/apt/recipes/elasticsearch8.rb
new file mode 100644 (file)
index 0000000..61a94f7
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: elasticsearch8
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "elasticsearch8.x" do
+  uri "https://artifacts.elastic.co/packages/8.x/apt"
+  distribution "stable"
+  components ["main"]
+  key "D27D666CD88E42B4"
+end
diff --git a/cookbooks/apt/recipes/git-core.rb b/cookbooks/apt/recipes/git-core.rb
new file mode 100644 (file)
index 0000000..79266ab
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Cookbook:: apt
+# Recipe:: git-core
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "git-core" do
+  uri "ppa:git-core/ppa"
+end
diff --git a/cookbooks/apt/recipes/grafana.rb b/cookbooks/apt/recipes/grafana.rb
new file mode 100644 (file)
index 0000000..5738c23
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: grafana
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "grafana" do
+  uri "https://packages.grafana.com/enterprise/deb"
+  distribution "stable"
+  components ["main"]
+  key "https://packages.grafana.com/gpg.key"
+end
diff --git a/cookbooks/apt/recipes/hwraid.rb b/cookbooks/apt/recipes/hwraid.rb
new file mode 100644 (file)
index 0000000..aa5a7fb
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: hwraid
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "hwraid" do
+  uri "https://hwraid.le-vert.net/ubuntu"
+  distribution "precise"
+  components ["main"]
+  key "6005210E23B3D3B4"
+end
diff --git a/cookbooks/apt/recipes/management-component-pack.rb b/cookbooks/apt/recipes/management-component-pack.rb
new file mode 100644 (file)
index 0000000..3b3f09b
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: management-component-pack
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "management-component-pack" do
+  uri "https://downloads.linux.hpe.com/SDR/repo/mcp"
+  distribution "bionic/current-gen9"
+  components ["non-free"]
+  key "C208ADDE26C2B797"
+end
diff --git a/cookbooks/apt/recipes/maxmind.rb b/cookbooks/apt/recipes/maxmind.rb
new file mode 100644 (file)
index 0000000..a0029aa
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Cookbook:: apt
+# Recipe:: maxmind
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "maxmind" do
+  uri "ppa:maxmind/ppa"
+end
diff --git a/cookbooks/apt/recipes/nginx.rb b/cookbooks/apt/recipes/nginx.rb
new file mode 100644 (file)
index 0000000..63fad62
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: nginx
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "nginx" do
+  arch "amd64"
+  uri "https://nginx.org/packages/ubuntu"
+  components ["nginx"]
+  key "ABF5BD827BD9BF62"
+end
diff --git a/cookbooks/apt/recipes/passenger.rb b/cookbooks/apt/recipes/passenger.rb
new file mode 100644 (file)
index 0000000..136175b
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# Cookbook:: apt
+# Recipe:: passenger
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "passenger" do
+  uri "https://oss-binaries.phusionpassenger.com/apt/passenger"
+  components ["main"]
+  key "561F9B9CAC40B2F7"
+end
diff --git a/cookbooks/apt/recipes/postgresql.rb b/cookbooks/apt/recipes/postgresql.rb
new file mode 100644 (file)
index 0000000..66e4c1c
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: postgresql
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "postgresql" do
+  uri "https://apt.postgresql.org/pub/repos/apt"
+  distribution "#{node[:lsb][:codename]}-pgdg"
+  components ["main"]
+  key "7FCC7D46ACCC4CF8"
+end
diff --git a/cookbooks/apt/recipes/timescaledb.rb b/cookbooks/apt/recipes/timescaledb.rb
new file mode 100644 (file)
index 0000000..57cccf2
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Cookbook:: apt
+# Recipe:: timescaledb
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+include_recipe "apt::postgresql"
+
+apt_repository "timescaledb" do
+  uri "https://packagecloud.io/timescale/timescaledb/ubuntu"
+  components ["main"]
+  key "https://packagecloud.io/timescale/timescaledb/gpgkey"
+end
diff --git a/cookbooks/apt/recipes/ubuntugis-stable.rb b/cookbooks/apt/recipes/ubuntugis-stable.rb
new file mode 100644 (file)
index 0000000..71ce209
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Cookbook:: apt
+# Recipe:: ubuntugis-stable
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "ubuntugis-stable" do
+  uri "ppa:ubuntugis/ppa"
+end
diff --git a/cookbooks/apt/recipes/ubuntugis-unstable.rb b/cookbooks/apt/recipes/ubuntugis-unstable.rb
new file mode 100644 (file)
index 0000000..3ab472b
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Cookbook:: apt
+# Recipe:: ubuntugis-unstable
+#
+# Copyright:: 2022, Tom Hughes
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apt"
+
+apt_repository "ubuntugis-unstable" do
+  uri "ppa:ubuntugis/ubuntugis-unstable"
+end
index 00c241a9633ed77148997d9114f2cefbdea0c200..ae018ba8880cde0457fbbfffaffd444b9c447041 100644 (file)
@@ -1,6 +1,3 @@
-# Add the opscode APT source for chef
-default[:apt][:sources] = node[:apt][:sources] | ["opscode"]
-
 # Set the default server version
 default[:chef][:server][:version] = "12.17.33"
 
diff --git a/cookbooks/docker/attributes/default.rb b/cookbooks/docker/attributes/default.rb
deleted file mode 100644 (file)
index f71e326..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Add the docker APT source
-default[:apt][:sources] = node[:apt][:sources] | ["docker"]
index 1dfe9adde7be0a60964551186b867a7e1aa30735..890c1c21fa324df1dcfd0cd7ae3933c5bfea5771 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::docker"
 
 package %w[
   docker-ce
index 1de57c968b7eb6c4148fc96ddd9279dd256237df..52f6b95990150821ebc0d5680225e4de0c7b2af2 100644 (file)
@@ -4,5 +4,3 @@ default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:low
 default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:high] = "90%"
 default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:flood_stage] = "95%"
 default[:elasticsearch][:path][:data] = "/var/lib/elasticsearch"
-
-default[:apt][:sources] |= ["elasticsearch#{node[:elasticsearch][:version]}"]
index cd7e8ff0165cea04d206aed537d2e43535bedbe3..05c6c27d5c24618f26029d9e064ad4bb87b9ed2b 100644 (file)
 # limitations under the License.
 #
 
-include_recipe "apt"
+case node[:elasticsearch][:version]
+when "6.x" then include_recipe "apt::elasticsearch6"
+when "8.x" then include_recipe "apt::elasticsearch8"
+end
 
 package "default-jre-headless"
 package "elasticsearch"
index 90476814c2cb80206d9ba1dc2bf6161987c7dc5d..878d4fbb5ecfe3466eac914f55fd1bb2b2f9b83b 100644 (file)
@@ -1,5 +1,3 @@
 default[:geoipupdate][:account] = "149244"
 default[:geoipupdate][:editions] = %w[GeoLite2-ASN GeoLite2-City GeoLite2-Country]
 default[:geoipupdate][:directory] = "/usr/share/GeoIP"
-
-default[:apt][:sources] |= ["maxmind"]
index 036c27881c06262bbfd00589a284dada2b992bdc..417d3201353a7a9ace9240812fcfcf6a1714c1c2 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::maxmind"
 
 license_keys = data_bag_item("geoipupdate", "license-keys")
 
index 7a4209f5d007809dec252284416562da0d31f01f..fd641f37a5b3472ec441a8acdde217a552883f14 100644 (file)
@@ -5,5 +5,3 @@ default[:git][:public_group] = "git"
 default[:git][:private_user] = "git"
 default[:git][:private_group] = "git"
 default[:git][:private_nodes] = "fqdn:*"
-
-default[:apt][:sources] |= ["git-core"]
index 49d43ae8225b62b2168fbd502cf4bf3ec34ea6c3..5db1fbe98f2cee2cba2fe2dbce6f82d56814d6dc 100644 (file)
@@ -17,6 +17,6 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::git-core"
 
 package "git"
index d2c1b36bd22c90d244dd9876ea7a934da104b035..c9d003e5745b2ce1a4a698ae4c48a2f96914aa10 100644 (file)
@@ -9,8 +9,6 @@ default[:hardware][:ipmi][:custom_args] = []
 if node[:dmi] && node[:dmi][:system]
   case node[:dmi][:system][:manufacturer]
   when "HP"
-    default[:apt][:sources] |= ["management-component-pack"]
-
     case node[:dmi][:system][:product_name]
     when "ProLiant DL360 G6", "ProLiant DL360 G7", "ProLiant SE326M1R2"
       default[:hardware][:sensors][:"power_meter-*"][:power][:power1] = { :ignore => true }
@@ -31,12 +29,6 @@ if Chef::Util.compare_versions(node[:kernel][:release], [3, 3]).negative?
   end
 end
 
-if node[:kernel] && node[:kernel][:modules]
-  raidmods = node[:kernel][:modules].keys & %w[cciss hpsa mptsas mpt2sas mpt3sas megaraid_mm megaraid_sas aacraid]
-
-  default[:apt][:sources] |= ["hwraid"] unless raidmods.empty?
-end
-
 if node[:kernel][:modules].include?("ipmi_si")
   default[:hardware][:modules] |= ["ipmi_devintf"]
 
index a77908cf4c7e4fc439b59ada912a11945749a2fb..96d3bb9373600e7a0aa4b79e4d1df47158cb717c 100644 (file)
@@ -17,7 +17,6 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
 include_recipe "git"
 include_recipe "munin"
 include_recipe "prometheus"
@@ -57,6 +56,8 @@ end
 
 case manufacturer
 when "HP"
+  include_recipe "apt::management-component-pack"
+
   package "hponcfg"
 
   execute "update-ilo" do
@@ -312,6 +313,8 @@ else
   end
 end
 
+include_recipe "apt::hwraid" unless status_packages.empty?
+
 if status_packages.include?("cciss-vol-status")
   template "/usr/local/bin/cciss-vol-statusd" do
     source "cciss-vol-statusd.erb"
index af74c9e4cf5fb2aca52e1ef4937c3592427560a8..2184da04864d2b093c5ab252c67690b75a782b94 100644 (file)
@@ -19,7 +19,7 @@
 
 require "yaml"
 
-include_recipe "apt"
+include_recipe "apt::elasticsearch8"
 
 package "filebeat"
 
index 21d22045bc60841f1e453369a6ffff924d97456e..e37b429997350aa7afe3e7507afc5079ac842a66 100644 (file)
@@ -14,6 +14,3 @@ default[:nginx][:cache][:proxy][:directory] = "/var/cache/nginx/proxy-cache"
 default[:nginx][:cache][:proxy][:keys_zone] = "proxy_cache_zone:128M"
 default[:nginx][:cache][:proxy][:inactive] = "45d"
 default[:nginx][:cache][:proxy][:max_size] = "16384M"
-
-# Enable nginx repository
-default[:apt][:sources] = node[:apt][:sources] | ["nginx"]
index d215e51c82a7176bc565fc00deab209587c20ce6..7053cb1b54e20446cb299f2590a7dd13e4c385c9 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::nginx"
 include_recipe "munin"
 include_recipe "prometheus"
 include_recipe "ssl"
index 2ac125c126008d471d9c58576619bcc500420a0d..1540a8592e58cc6e37204cb3ff20fdd7d2b176fb 100644 (file)
@@ -1,5 +1,3 @@
 default[:passenger][:max_pool_size] = 6
 default[:passenger][:pool_idle_time] = 300
 default[:passenger][:instance_registry_dir] = "/run/passenger"
-
-default[:apt][:sources] = node[:apt][:sources] | ["passenger"]
index f8ea95808c4ac38dcb21c9d85e5ee63b69d4d1fc..74eba83eb0fb5ad84c1dab4bf339d1783f910688 100644 (file)
@@ -18,7 +18,7 @@
 #
 
 include_recipe "apache"
-include_recipe "apt"
+include_recipe "apt::passenger"
 include_recipe "munin"
 include_recipe "prometheus"
 include_recipe "ruby"
index 770c0dbeacf1b3eccbf40e14ccf715318e055945..568e53b5768a2cbc312185b9d8ec9e6d622098e1 100644 (file)
@@ -49,5 +49,3 @@ default[:postgresql][:settings][:defaults][:user_name_maps] = {}
 default[:postgresql][:settings][:defaults][:early_authentication_rules] = []
 default[:postgresql][:settings][:defaults][:late_authentication_rules] = []
 default[:postgresql][:settings][:defaults][:standby_mode] = "off"
-
-default[:apt][:sources] = node[:apt][:sources] | ["postgresql"]
index b5e7be908ceea5ac55e52b525d3ef732bdc755bb..a17b38084d12227a533f8a07fda4ec28d32de27d 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::postgresql"
 include_recipe "munin"
 include_recipe "prometheus"
 
index 7b6feed284033b5363280143a83576ae0fb968ee..a104883e7b12079ca2a7900741fa58439c26300e 100644 (file)
@@ -4,7 +4,3 @@ default[:prometheus][:snmp] = {}
 default[:prometheus][:metrics] = {}
 default[:prometheus][:files] = []
 default[:prometheus][:promscale] = true
-
-if node[:recipes].include?("prometheus::server")
-  default[:apt][:sources] |= %w[grafana timescaledb]
-end
index 94e33c033842f5f30a7f6a97f4c1ad3b3880ccec..fab3f4652605769c7310c8b04a5c6105b59cf5f7 100644 (file)
@@ -18,7 +18,8 @@
 #
 
 include_recipe "apache"
-include_recipe "apt"
+include_recipe "apt::grafana"
+include_recipe "apt::timescaledb"
 include_recipe "networking"
 include_recipe "timescaledb"
 
index 9c789bffcfcbd512a43e745e374392e4162c1e28..3aa5110aac28b088d91ec5e77ec12a56dcb33f3b 100644 (file)
@@ -1,4 +1,2 @@
 default[:timescaledb][:database_version] = "14"
 default[:timescaledb][:max_background_workers] = 8
-
-default[:apt][:sources] |= ["timescaledb"]
index a9878595a429a556b38f35679c2c0e84fed366ef..05085d948c98224f3bec618a7f1917b3817f87b7 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-include_recipe "apt"
+include_recipe "apt::timescaledb"
 
 database_version = node[:timescaledb][:database_version]
 
index 466e575f1c259bb7c60f63512ef199f7a1062df1..bafa81db75bf0647e5c77a8e01c77217bccfb2f8 100644 (file)
@@ -2,9 +2,6 @@ name "foundation"
 description "Role applied to all OSMF servers"
 
 default_attributes(
-  :apt => {
-    :sources => ["passenger"]
-  },
   :elasticsearch => {
     :version => "6.x",
     :cluster => {
index 635e197fa8dee4ebdd487a9a154f0faa590f6d09..7dd1ddfecd66581f916cfdf7860f4e7ef42be2e6 100644 (file)
@@ -2,9 +2,6 @@ name "ironbelly"
 description "Master role applied to ironbelly"
 
 default_attributes(
-  :apt => {
-    :sources => ["ubuntugis-unstable"]
-  },
   :bind => {
     :clients => "equinix-ams"
   },
index 509934ae4cad8877557a710e86f754f55cf5edfa..bb0b777f3d1602e2ceaebb2a58e7666080fd8626 100644 (file)
@@ -1,12 +1,6 @@
 name "logstash-forwarder"
 description "Role applied to all logstash forwarders"
 
-default_attributes(
-  :apt => {
-    :sources => ["elasticsearch8.x"]
-  }
-)
-
 run_list(
   "recipe[logstash::forwarder]"
 )