From dc761f2a386d02f1f1f5e297fc6e04a45b0dcccf Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Fri, 19 Feb 2010 15:34:36 +0200 Subject: [PATCH] Purge unmanaged files from managed configuration directories. --- apache/manifests/init.pp | 18 ++++++++++++++++-- backuppc/manifests/init.pp | 5 ++++- custom/files/empty/README | 1 + munin/manifests/init.pp | 6 +++++- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 custom/files/empty/README diff --git a/apache/manifests/init.pp b/apache/manifests/init.pp index ca82e31..9f35bd6 100644 --- a/apache/manifests/init.pp +++ b/apache/manifests/init.pp @@ -61,13 +61,20 @@ class apache::server inherits apache::common { "/srv/www/log/http", "/srv/www/log/http/${fqdn}", ]: ensure => directory, - mode => 0755, + mode => 0644, owner => root, group => root, require => Package["httpd"], before => File["/etc/httpd/conf/httpd.conf"], } + File["/etc/httpd/conf.http.d", "/etc/httpd/site.http.d"] { + purge => true, + force => true, + recurse => true, + source => "puppet:///custom/empty", + } + file { "/etc/httpd/conf/httpd.conf": ensure => present, content => template("apache/httpd.conf.erb"), @@ -205,13 +212,20 @@ class apache::sslserver inherits apache::common { "/srv/www/log/https", "/srv/www/log/https/${fqdn}", ]: ensure => directory, - mode => 0755, + mode => 0644, owner => root, group => root, require => Package["httpd"], before => File["/etc/httpd/conf/httpsd.conf"], } + File["/etc/httpd/conf.https.d", "/etc/httpd/site.https.d"] { + purge => true, + force => true, + recurse => true, + source => "puppet:///custom/empty", + } + file { "/etc/httpd/conf/httpsd.conf": ensure => present, mode => 0644, diff --git a/backuppc/manifests/init.pp b/backuppc/manifests/init.pp index 3914e82..3dfe6bd 100644 --- a/backuppc/manifests/init.pp +++ b/backuppc/manifests/init.pp @@ -95,9 +95,12 @@ class backuppc::server { file { "/etc/BackupPC/pc": ensure => directory, purge => true, - mode => 0750, + force => true, + recurse => true, + mode => 0640, owner => root, group => backuppc, + source => "puppet:///custom/empty", require => Package["BackupPC"], } diff --git a/custom/files/empty/README b/custom/files/empty/README new file mode 100644 index 0000000..9c3729d --- /dev/null +++ b/custom/files/empty/README @@ -0,0 +1 @@ +# This directory is managed by puppet. All unmanaged files will be removed. diff --git a/munin/manifests/init.pp b/munin/manifests/init.pp index a820f5e..75722a9 100644 --- a/munin/manifests/init.pp +++ b/munin/manifests/init.pp @@ -175,9 +175,13 @@ class munin::server { file { "/etc/munin/nodes.d": ensure => directory, + purge => true, + force => true, + recurse => true, owner => root, group => root, - mode => 0755, + mode => 0644, + source => "puppet:///custom/empty", require => Package["munin"], }