From a30a4c6bc158c351474d20b25ab67025aba95b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 19 Oct 2023 17:55:23 +0200 Subject: Take ownership of /etc/periodic.conf. File_line just added the rule every time, and since we already include directories the file shouldn't need to be modified by anyone else. --- manifests/setup.pp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'manifests') diff --git a/manifests/setup.pp b/manifests/setup.pp index 360f73f..7da74ed 100644 --- a/manifests/setup.pp +++ b/manifests/setup.pp @@ -15,19 +15,17 @@ class periodic::setup ( String $suffix = '.periodic', Enum['present', 'absent'] $ensure = 'present', ) { + $purge_str = if $purge { '' } else { 'NOT' } $content = @("EOF"/$) + # File managed by puppet + # ${periodic_dir} is currently ${purge_str} in purge mode periodic_conf_files="${periodic_dir}/*${suffix} \${periodic_conf_files}" | EOF - file { '/etc/periodic.conf': - ensure => file, - } - # /etc/perodic.conf is included from /etc/defaults/peroidic.conf - file_line { 'Periodic - Enable sourcing of files in directory': - ensure => $ensure, - path => '/etc/periodic.conf', - line => $content, + file { '/etc/periodic.conf': + ensure => file, + content => $content, } file { $periodic_dir: -- cgit v1.2.3