]> git.openstreetmap.org Git - chef.git/commitdiff
Run smartmontools update-smart-drivedb occasionally
authorGrant Slater <git@firefishy.com>
Fri, 18 Sep 2020 20:54:52 +0000 (21:54 +0100)
committerGrant Slater <git@firefishy.com>
Fri, 18 Sep 2020 20:54:52 +0000 (21:54 +0100)
cookbooks/hardware/recipes/default.rb
cookbooks/hardware/templates/default/update-smart-drivedb.erb [new file with mode: 0644]

index 7799058e1d8875a4f4270a619ed2a63c6592de4e..90505366370844bd2e67240ff473cd5e0b85e1f7 100644 (file)
@@ -402,6 +402,13 @@ disks = disks.compact.uniq
 if disks.count.positive?
   package "smartmontools"
 
+  template "/etc/cron.daily/update-smart-drivedb" do
+    source "expire.cron.erb"
+    owner "root"
+    group "root"
+    mode "755"
+  end
+
   template "/usr/local/bin/smartd-mailer" do
     source "smartd-mailer.erb"
     owner "root"
diff --git a/cookbooks/hardware/templates/default/update-smart-drivedb.erb b/cookbooks/hardware/templates/default/update-smart-drivedb.erb
new file mode 100644 (file)
index 0000000..f8030c1
--- /dev/null
@@ -0,0 +1,10 @@
+#/bin/bash
+# DO NOT EDIT - This file is being maintained by Chef
+
+set -eu
+
+if [ -x /usr/sbin/update-smart-drivedb ]; then
+  /usr/sbin/update-smart-drivedb -u github
+fi
+
+exit 0