diff options
| author | alex <alex@pdp7.net> | 2023-01-21 22:22:48 +0100 |
|---|---|---|
| committer | alex <alex@pdp7.net> | 2023-01-21 22:23:06 +0100 |
| commit | 5c8bd89e050c2d6b572c09daefbae0e5ad388c47 (patch) | |
| tree | 0064b77375a25d05fb40761aecebb04f159db4ef /personal_infra/puppet/modules/automatic_updates/manifests/init.pp | |
| parent | 7a01ae757dd6b1ea6d27dfa21dd79564ecda29c5 (diff) | |
Extend support for automatic_updates, fail if unsupported
Diffstat (limited to 'personal_infra/puppet/modules/automatic_updates/manifests/init.pp')
| -rw-r--r-- | personal_infra/puppet/modules/automatic_updates/manifests/init.pp | 28 |
1 files changed, 28 insertions, 0 deletions
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']) + } } |
