From b73176eda2a83b7fc0170a5639ad036b1c897773 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 22 Sep 2022 23:07:58 +0100 Subject: [PATCH] Rework apt repository configuration 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. --- .kitchen.yml | 7 -- cookbooks/apt/attributes/default.rb | 1 - cookbooks/apt/recipes/default.rb | 103 ------------------ cookbooks/apt/recipes/docker.rb | 27 +++++ cookbooks/apt/recipes/elasticsearch6.rb | 27 +++++ cookbooks/apt/recipes/elasticsearch8.rb | 27 +++++ cookbooks/apt/recipes/git-core.rb | 24 ++++ cookbooks/apt/recipes/grafana.rb | 27 +++++ cookbooks/apt/recipes/hwraid.rb | 27 +++++ .../apt/recipes/management-component-pack.rb | 27 +++++ cookbooks/apt/recipes/maxmind.rb | 24 ++++ cookbooks/apt/recipes/nginx.rb | 27 +++++ cookbooks/apt/recipes/passenger.rb | 26 +++++ cookbooks/apt/recipes/postgresql.rb | 27 +++++ cookbooks/apt/recipes/timescaledb.rb | 27 +++++ cookbooks/apt/recipes/ubuntugis-stable.rb | 24 ++++ cookbooks/apt/recipes/ubuntugis-unstable.rb | 24 ++++ cookbooks/chef/attributes/default.rb | 3 - cookbooks/docker/attributes/default.rb | 2 - cookbooks/docker/recipes/default.rb | 2 +- cookbooks/elasticsearch/attributes/default.rb | 2 - cookbooks/elasticsearch/recipes/default.rb | 5 +- cookbooks/geoipupdate/attributes/default.rb | 2 - cookbooks/geoipupdate/recipes/default.rb | 2 +- cookbooks/git/attributes/default.rb | 2 - cookbooks/git/recipes/default.rb | 2 +- cookbooks/hardware/attributes/default.rb | 8 -- cookbooks/hardware/recipes/default.rb | 5 +- cookbooks/logstash/recipes/forwarder.rb | 2 +- cookbooks/nginx/attributes/default.rb | 3 - cookbooks/nginx/recipes/default.rb | 2 +- cookbooks/passenger/attributes/default.rb | 2 - cookbooks/passenger/recipes/default.rb | 2 +- cookbooks/postgresql/attributes/default.rb | 2 - cookbooks/postgresql/recipes/default.rb | 2 +- cookbooks/prometheus/attributes/default.rb | 4 - cookbooks/prometheus/recipes/server.rb | 3 +- cookbooks/timescaledb/attributes/default.rb | 2 - cookbooks/timescaledb/recipes/default.rb | 2 +- roles/foundation.rb | 3 - roles/ironbelly.rb | 3 - roles/logstash-forwarder.rb | 6 - 42 files changed, 383 insertions(+), 166 deletions(-) create mode 100644 cookbooks/apt/recipes/docker.rb create mode 100644 cookbooks/apt/recipes/elasticsearch6.rb create mode 100644 cookbooks/apt/recipes/elasticsearch8.rb create mode 100644 cookbooks/apt/recipes/git-core.rb create mode 100644 cookbooks/apt/recipes/grafana.rb create mode 100644 cookbooks/apt/recipes/hwraid.rb create mode 100644 cookbooks/apt/recipes/management-component-pack.rb create mode 100644 cookbooks/apt/recipes/maxmind.rb create mode 100644 cookbooks/apt/recipes/nginx.rb create mode 100644 cookbooks/apt/recipes/passenger.rb create mode 100644 cookbooks/apt/recipes/postgresql.rb create mode 100644 cookbooks/apt/recipes/timescaledb.rb create mode 100644 cookbooks/apt/recipes/ubuntugis-stable.rb create mode 100644 cookbooks/apt/recipes/ubuntugis-unstable.rb delete mode 100644 cookbooks/docker/attributes/default.rb diff --git a/.kitchen.yml b/.kitchen.yml index 88d2e6ca2..a54f1f29d 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -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: diff --git a/cookbooks/apt/attributes/default.rb b/cookbooks/apt/attributes/default.rb index a949a1c02..6ec384b5d 100644 --- a/cookbooks/apt/attributes/default.rb +++ b/cookbooks/apt/attributes/default.rb @@ -1,3 +1,2 @@ -default[:apt][:sources] = [ "openstreetmap" ] default[:apt][:unattended_upgrades][:enable] = true default[:apt][:unattended_upgrades][:remove_unused_dependencies] = true diff --git a/cookbooks/apt/recipes/default.rb b/cookbooks/apt/recipes/default.rb index fc5341ec5..1d73a4d9b 100644 --- a/cookbooks/apt/recipes/default.rb +++ b/cookbooks/apt/recipes/default.rb @@ -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 index 000000000..f28c15b0b --- /dev/null +++ b/cookbooks/apt/recipes/docker.rb @@ -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 index 000000000..74c02a324 --- /dev/null +++ b/cookbooks/apt/recipes/elasticsearch6.rb @@ -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 index 000000000..61a94f7aa --- /dev/null +++ b/cookbooks/apt/recipes/elasticsearch8.rb @@ -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 index 000000000..79266ab33 --- /dev/null +++ b/cookbooks/apt/recipes/git-core.rb @@ -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 index 000000000..5738c23d4 --- /dev/null +++ b/cookbooks/apt/recipes/grafana.rb @@ -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 index 000000000..aa5a7fb91 --- /dev/null +++ b/cookbooks/apt/recipes/hwraid.rb @@ -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 index 000000000..3b3f09b09 --- /dev/null +++ b/cookbooks/apt/recipes/management-component-pack.rb @@ -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 index 000000000..a0029aae1 --- /dev/null +++ b/cookbooks/apt/recipes/maxmind.rb @@ -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 index 000000000..63fad62fc --- /dev/null +++ b/cookbooks/apt/recipes/nginx.rb @@ -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 index 000000000..136175ba0 --- /dev/null +++ b/cookbooks/apt/recipes/passenger.rb @@ -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 index 000000000..66e4c1c92 --- /dev/null +++ b/cookbooks/apt/recipes/postgresql.rb @@ -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 index 000000000..57cccf2b2 --- /dev/null +++ b/cookbooks/apt/recipes/timescaledb.rb @@ -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 index 000000000..71ce20979 --- /dev/null +++ b/cookbooks/apt/recipes/ubuntugis-stable.rb @@ -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 index 000000000..3ab472b0e --- /dev/null +++ b/cookbooks/apt/recipes/ubuntugis-unstable.rb @@ -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 diff --git a/cookbooks/chef/attributes/default.rb b/cookbooks/chef/attributes/default.rb index 00c241a96..ae018ba88 100644 --- a/cookbooks/chef/attributes/default.rb +++ b/cookbooks/chef/attributes/default.rb @@ -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 index f71e326f3..000000000 --- a/cookbooks/docker/attributes/default.rb +++ /dev/null @@ -1,2 +0,0 @@ -# Add the docker APT source -default[:apt][:sources] = node[:apt][:sources] | ["docker"] diff --git a/cookbooks/docker/recipes/default.rb b/cookbooks/docker/recipes/default.rb index 1dfe9adde..890c1c21f 100644 --- a/cookbooks/docker/recipes/default.rb +++ b/cookbooks/docker/recipes/default.rb @@ -17,7 +17,7 @@ # limitations under the License. # -include_recipe "apt" +include_recipe "apt::docker" package %w[ docker-ce diff --git a/cookbooks/elasticsearch/attributes/default.rb b/cookbooks/elasticsearch/attributes/default.rb index 1de57c968..52f6b9599 100644 --- a/cookbooks/elasticsearch/attributes/default.rb +++ b/cookbooks/elasticsearch/attributes/default.rb @@ -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]}"] diff --git a/cookbooks/elasticsearch/recipes/default.rb b/cookbooks/elasticsearch/recipes/default.rb index cd7e8ff01..05c6c27d5 100644 --- a/cookbooks/elasticsearch/recipes/default.rb +++ b/cookbooks/elasticsearch/recipes/default.rb @@ -17,7 +17,10 @@ # 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" diff --git a/cookbooks/geoipupdate/attributes/default.rb b/cookbooks/geoipupdate/attributes/default.rb index 90476814c..878d4fbb5 100644 --- a/cookbooks/geoipupdate/attributes/default.rb +++ b/cookbooks/geoipupdate/attributes/default.rb @@ -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"] diff --git a/cookbooks/geoipupdate/recipes/default.rb b/cookbooks/geoipupdate/recipes/default.rb index 036c27881..417d32013 100644 --- a/cookbooks/geoipupdate/recipes/default.rb +++ b/cookbooks/geoipupdate/recipes/default.rb @@ -17,7 +17,7 @@ # limitations under the License. # -include_recipe "apt" +include_recipe "apt::maxmind" license_keys = data_bag_item("geoipupdate", "license-keys") diff --git a/cookbooks/git/attributes/default.rb b/cookbooks/git/attributes/default.rb index 7a4209f5d..fd641f37a 100644 --- a/cookbooks/git/attributes/default.rb +++ b/cookbooks/git/attributes/default.rb @@ -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"] diff --git a/cookbooks/git/recipes/default.rb b/cookbooks/git/recipes/default.rb index 49d43ae82..5db1fbe98 100644 --- a/cookbooks/git/recipes/default.rb +++ b/cookbooks/git/recipes/default.rb @@ -17,6 +17,6 @@ # limitations under the License. # -include_recipe "apt" +include_recipe "apt::git-core" package "git" diff --git a/cookbooks/hardware/attributes/default.rb b/cookbooks/hardware/attributes/default.rb index d2c1b36bd..c9d003e57 100644 --- a/cookbooks/hardware/attributes/default.rb +++ b/cookbooks/hardware/attributes/default.rb @@ -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"] diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index a77908cf4..96d3bb937 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -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" diff --git a/cookbooks/logstash/recipes/forwarder.rb b/cookbooks/logstash/recipes/forwarder.rb index af74c9e4c..2184da048 100644 --- a/cookbooks/logstash/recipes/forwarder.rb +++ b/cookbooks/logstash/recipes/forwarder.rb @@ -19,7 +19,7 @@ require "yaml" -include_recipe "apt" +include_recipe "apt::elasticsearch8" package "filebeat" diff --git a/cookbooks/nginx/attributes/default.rb b/cookbooks/nginx/attributes/default.rb index 21d22045b..e37b42999 100644 --- a/cookbooks/nginx/attributes/default.rb +++ b/cookbooks/nginx/attributes/default.rb @@ -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"] diff --git a/cookbooks/nginx/recipes/default.rb b/cookbooks/nginx/recipes/default.rb index d215e51c8..7053cb1b5 100644 --- a/cookbooks/nginx/recipes/default.rb +++ b/cookbooks/nginx/recipes/default.rb @@ -17,7 +17,7 @@ # limitations under the License. # -include_recipe "apt" +include_recipe "apt::nginx" include_recipe "munin" include_recipe "prometheus" include_recipe "ssl" diff --git a/cookbooks/passenger/attributes/default.rb b/cookbooks/passenger/attributes/default.rb index 2ac125c12..1540a8592 100644 --- a/cookbooks/passenger/attributes/default.rb +++ b/cookbooks/passenger/attributes/default.rb @@ -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"] diff --git a/cookbooks/passenger/recipes/default.rb b/cookbooks/passenger/recipes/default.rb index f8ea95808..74eba83eb 100644 --- a/cookbooks/passenger/recipes/default.rb +++ b/cookbooks/passenger/recipes/default.rb @@ -18,7 +18,7 @@ # include_recipe "apache" -include_recipe "apt" +include_recipe "apt::passenger" include_recipe "munin" include_recipe "prometheus" include_recipe "ruby" diff --git a/cookbooks/postgresql/attributes/default.rb b/cookbooks/postgresql/attributes/default.rb index 770c0dbea..568e53b57 100644 --- a/cookbooks/postgresql/attributes/default.rb +++ b/cookbooks/postgresql/attributes/default.rb @@ -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"] diff --git a/cookbooks/postgresql/recipes/default.rb b/cookbooks/postgresql/recipes/default.rb index b5e7be908..a17b38084 100644 --- a/cookbooks/postgresql/recipes/default.rb +++ b/cookbooks/postgresql/recipes/default.rb @@ -17,7 +17,7 @@ # limitations under the License. # -include_recipe "apt" +include_recipe "apt::postgresql" include_recipe "munin" include_recipe "prometheus" diff --git a/cookbooks/prometheus/attributes/default.rb b/cookbooks/prometheus/attributes/default.rb index 7b6feed28..a104883e7 100644 --- a/cookbooks/prometheus/attributes/default.rb +++ b/cookbooks/prometheus/attributes/default.rb @@ -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 diff --git a/cookbooks/prometheus/recipes/server.rb b/cookbooks/prometheus/recipes/server.rb index 94e33c033..fab3f4652 100644 --- a/cookbooks/prometheus/recipes/server.rb +++ b/cookbooks/prometheus/recipes/server.rb @@ -18,7 +18,8 @@ # include_recipe "apache" -include_recipe "apt" +include_recipe "apt::grafana" +include_recipe "apt::timescaledb" include_recipe "networking" include_recipe "timescaledb" diff --git a/cookbooks/timescaledb/attributes/default.rb b/cookbooks/timescaledb/attributes/default.rb index 9c789bffc..3aa5110aa 100644 --- a/cookbooks/timescaledb/attributes/default.rb +++ b/cookbooks/timescaledb/attributes/default.rb @@ -1,4 +1,2 @@ default[:timescaledb][:database_version] = "14" default[:timescaledb][:max_background_workers] = 8 - -default[:apt][:sources] |= ["timescaledb"] diff --git a/cookbooks/timescaledb/recipes/default.rb b/cookbooks/timescaledb/recipes/default.rb index a9878595a..05085d948 100644 --- a/cookbooks/timescaledb/recipes/default.rb +++ b/cookbooks/timescaledb/recipes/default.rb @@ -17,7 +17,7 @@ # limitations under the License. # -include_recipe "apt" +include_recipe "apt::timescaledb" database_version = node[:timescaledb][:database_version] diff --git a/roles/foundation.rb b/roles/foundation.rb index 466e575f1..bafa81db7 100644 --- a/roles/foundation.rb +++ b/roles/foundation.rb @@ -2,9 +2,6 @@ name "foundation" description "Role applied to all OSMF servers" default_attributes( - :apt => { - :sources => ["passenger"] - }, :elasticsearch => { :version => "6.x", :cluster => { diff --git a/roles/ironbelly.rb b/roles/ironbelly.rb index 635e197fa..7dd1ddfec 100644 --- a/roles/ironbelly.rb +++ b/roles/ironbelly.rb @@ -2,9 +2,6 @@ name "ironbelly" description "Master role applied to ironbelly" default_attributes( - :apt => { - :sources => ["ubuntugis-unstable"] - }, :bind => { :clients => "equinix-ams" }, diff --git a/roles/logstash-forwarder.rb b/roles/logstash-forwarder.rb index 509934ae4..bb0b777f3 100644 --- a/roles/logstash-forwarder.rb +++ b/roles/logstash-forwarder.rb @@ -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]" ) -- 2.45.1