From 5c8bd89e050c2d6b572c09daefbae0e5ad388c47 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 21 Jan 2023 22:22:48 +0100 Subject: Extend support for automatic_updates, fail if unsupported --- .../modules/automatic_updates/manifests/init.pp | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'personal_infra/puppet/modules/automatic_updates/manifests') diff --git a/personal_infra/puppet/modules/automatic_updates/manifests/init.pp b/personal_infra/puppet/modules/automatic_updates/manifests/init.pp index d5f0e629..eed91aa0 100644 --- a/personal_infra/puppet/modules/automatic_updates/manifests/init.pp +++ b/personal_infra/puppet/modules/automatic_updates/manifests/init.pp @@ -2,4 +2,32 @@ class automatic_updates { if ($facts['os']['family'] == 'Debian') { package {["unattended-upgrades", "apt-listchanges"]:} } + elsif ($facts['os']['family'] == 'RedHat') { + if ($facts['os']['release']['major'] == '7') { + package {'yum-cron':} + -> + file {"/etc/yum/yum-cron.conf": + content => epp('automatic_updates/yum-cron.conf'), + } + ~> + service {'yum-cron': + ensure => running, + enable => true, + } + } + elsif ($facts['os']['release']['major'] == '8') { + package {'dnf-automatic':} + -> + service {'dnf-automatic-install.timer': + ensure => running, + enable => true, + } + } + else { + fail($facts['os']['release']['major']) + } + } + else { + fail($facts['os']) + } } -- cgit v1.2.3