changeset 455:a32771c91043

Switch updates available/restart required to script This lets the script manage whether it's on Ubuntu or CentOS and whether it needs yum commands or apt.
author IBBoard <dev@ibboard.co.uk>
date Sun, 20 Aug 2023 13:28:10 +0100
parents d0e7979c7e8c
children 66e0e8f9e82a
files manifests/templates.pp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/manifests/templates.pp	Sun Aug 13 15:26:37 2023 +0100
+++ b/manifests/templates.pp	Sun Aug 20 13:28:10 2023 +0100
@@ -1095,14 +1095,17 @@
 	}
 	# Notify of available updates
 	cron { 'check-yum-updates':
-		command => '/usr/bin/yum check-update | grep -E "^[^ ]+ +[0-9a-z:_\.-]+ +[^ ]+\s*\$"',
+		ensure => absent,
+	}
+	cron { 'check-for-updates':
+		command => '/usr/local/bin/check-updates',
 		hour => '4',
 		minute => '30',
 		weekday => '0-6/3', #Sunday, Wednesday and Saturday morning
 	}
 	# And check whether anything needs restarting
 	cron { 'check-needs-restarting':
-		command => '/usr/bin/needs-restarting|grep -v "/usr/lib/systemd\|/usr/sbin/lvmetad\|/usr/lib/polkit-1/polkitd"',
+		command => '/usr/local/bin/needs-restarting',
 		hour => '4',
 		minute => '45',
 		weekday => '0-6/3', #Sunday, Wednesday and Saturday morning