From 1bfdfac0a500ec5752e0f96624ad3b0e4e2ff6d3 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Fri, 18 Sep 2020 21:54:52 +0100 Subject: [PATCH] Run smartmontools update-smart-drivedb occasionally --- cookbooks/hardware/recipes/default.rb | 7 +++++++ .../templates/default/update-smart-drivedb.erb | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 cookbooks/hardware/templates/default/update-smart-drivedb.erb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 7799058e1..905053663 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -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 index 000000000..f8030c168 --- /dev/null +++ b/cookbooks/hardware/templates/default/update-smart-drivedb.erb @@ -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 -- 2.45.1