]> git.openstreetmap.org Git - chef.git/commitdiff
Merge remote-tracking branch 'github/pull/590'
authorTom Hughes <tom@compton.nu>
Tue, 20 Jun 2023 17:39:51 +0000 (18:39 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 20 Jun 2023 17:39:51 +0000 (18:39 +0100)
.kitchen.yml
cookbooks/apt/templates/default/apt.conf.erb
cookbooks/hardware/recipes/default.rb
cookbooks/imagery/recipes/lu_lidar_hillshade.rb
cookbooks/imagery/recipes/lu_ngl_dtm.rb
cookbooks/networking/recipes/default.rb
cookbooks/prometheus/templates/default/alert_rules.yml.erb

index 0a18ae0866eb2c1ed851ce20e5e4e10e97bc5dbc..87b4dfdda5d32f56787724978975fb32067d8241 100644 (file)
@@ -37,9 +37,9 @@ platforms:
       pid_one_command: /bin/systemd
       intermediate_instructions:
         - RUN /usr/bin/apt-get update -y
-  - name: debian-11
+  - name: debian-12
     driver:
-      image: dokken/debian-11
+      image: dokken/debian-12
       privileged: true
       pid_one_command: /bin/systemd
       intermediate_instructions:
index 730678e581cfe36b8e41213eaafe3f7fa1b2d59f..8943458e9359229907fe6e1b25b30de3f4012fb0 100644 (file)
@@ -7,3 +7,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "<%= node[:apt][:unattended_upgra
 // Don't install recommended packages as we don't want to get
 // new postgres versions automatically
 APT::Install-Recommends "false";
+
+// Briefly wait for lock on dpkg/apt
+// to avoid concurrent issues with unattended-upgrades and apt daily
+DPkg::lock::timeout 90;
index 119176cd6327597a9e6a2aca7e43bae9cde737f2..5e48994764716fc93232bcdddeabbac66fed82a4 100644 (file)
@@ -28,11 +28,13 @@ ohai_plugin "hardware" do
   template "ohai.rb.erb"
 end
 
-case node[:cpu][:"0"][:vendor_id]
-when "GenuineIntel"
-  package "intel-microcode"
-when "AuthenticAMD"
-  package "amd64-microcode"
+if node[:cpu] && node[:cpu][:"0"] && node[:cpu][:"0"][:vendor_id]
+  case node[:cpu][:"0"][:vendor_id]
+  when "GenuineIntel"
+    package "intel-microcode"
+  when "AuthenticAMD"
+    package "amd64-microcode"
+  end
 end
 
 if node[:dmi] && node[:dmi][:system]
@@ -204,9 +206,20 @@ template "/etc/initramfs-tools/conf.d/mdadm" do
   notifies :run, "execute[update-initramfs]"
 end
 
-package "haveged"
-service "haveged" do
-  action [:enable, :start]
+# haveged is only required on older kernels
+# /dev/random is not blocking anymore in 5.15+
+if Chef::Util.compare_versions(node[:kernel][:release], [5, 15]).negative?
+  package "haveged"
+  service "haveged" do
+    action [:enable, :start]
+  end
+else
+  service "haveged" do
+    action [:stop, :disable]
+  end
+  package "haveged" do
+    action :remove
+  end
 end
 
 if node[:kernel][:modules].include?("ipmi_si")
index c80742946a775a3b051468686c01dd4f853b2192..a6a277bc34ef853f20861494b03a042fd33817e8 100644 (file)
@@ -33,11 +33,7 @@ end
 
 imagery_layer "mappers_delight_lidar_dem_2019" do
   site "lidar-hillshade-2019.openstreetmap.lu"
-  projection "EPSG:3857"
-  source "/data/imagery/lu/lidar-hillshade/dem-3857.tif"
-  max_zoom 20
-  title "OpenStreetMap.lu Mapper's Delight 2019 Lidar DEM"
-  copyright 'Lidar data 2019 <a href="https://data.public.lu/fr/datasets/lidar-2019-releve-3d-du-territoire-luxembourgeois">Administration du Cadastre et de la Topographie Luxembourg</a>, DEM <a href="https://twitter.com/grischard">Guillaume Rischard</a>, CC0'
+  action :delete
 end
 
 imagery_layer "mappers_delight_lidar_hillshade_2019_reprojected" do
index 528c408e02a48b09287c2d932fe0299e35ef71ab..e3133bf9f25cc607218176104e3f2af0595401d0 100644 (file)
@@ -26,20 +26,12 @@ end
 
 imagery_layer "ana_dtm_2017" do
   site "ana-dtm-2017.openstreetmap.lu"
-  projection "EPSG:3857"
-  source "/data/imagery/lu/LUREF_NGL/lu_color_relief-epsg3857-compress.tif"
-  max_zoom 21
-  title "DTM"
-  copyright '&copy; 2017 <a href="https://data.public.lu/fr/datasets/digital-terrain-model-high-dem-resolution/">Administration de la Navigation A&eacute;rienne Luxembourg</a>, CC0'
+  action :delete
 end
 
 imagery_layer "ana_dtm_2017_hillshading" do
   site "ana-dtm-2017.openstreetmap.lu"
-  projection "EPSG:3857"
-  source "/data/imagery/lu/LUREF_NGL/lu_hillshade_2017-epsg-3857-compress.tif"
-  max_zoom 21
-  title "DTM Hillshading (single light source)"
-  copyright '&copy; 2017 <a href="https://data.public.lu/fr/datasets/digital-terrain-model-high-dem-resolution/">Administration de la Navigation A&eacute;rienne Luxembourg</a>, CC0'
+  action :delete
 end
 
 imagery_layer "ana_dtm_2017_hillshading_multi" do
index 11c75daec981d3d63bdc422119db4780eb041427..60f3be44481bcd9365e2c7f4acd8c62761a8780b 100644 (file)
@@ -126,6 +126,11 @@ node[:networking][:interfaces].each do |_, interface|
   end
 end
 
+package "systemd-resolved" do
+  action :install
+  only_if { platform?("ubuntu") && node[:lsb][:release].to_f > 22.04 || platform?("debian") && node[:lsb][:release].to_f > 11.0 }
+end
+
 service "systemd-networkd" do
   action [:enable, :start]
 end
index 8956104a8986b210ad10393982e3bb09e596f434..396de8de43001ed12dbce7aeca8a26f1fc55b0df 100644 (file)
@@ -3,6 +3,13 @@
 groups:
   - name: amsterdam
     rules:
+      - alert: uplink
+        expr: ifOperStatus{site="amsterdam",ifName=~"ge-[01]/2/2"} != 1
+        for: 6m
+        labels:
+          alertgroup: "amsterdam"
+        annotations:
+          status: "{{ $value }}"
       - alert: pdu current draw
         expr: rPDU2PhaseStatusCurrent{site="amsterdam",rPDU2PhaseStatusIndex="1"} / 10 > 28
         for: 6m
@@ -109,6 +116,13 @@ groups:
           failure_rate: "{{ $value }} jobs/s"
   - name: dublin
     rules:
+      - alert: uplink
+        expr: ifOperStatus{site="dublin",ifName=~"ge-[01]/2/2"} != 1
+        for: 6m
+        labels:
+          alertgroup: "dublin"
+        annotations:
+          status: "{{ $value }}"
       - alert: pdu current draw
         expr: rPDU2PhaseStatusCurrent{site="dublin",rPDU2PhaseStatusIndex="1"} / 10 > 28
         for: 6m