Faidon has submitted this change and it was merged.

Change subject: Remove 'eventlogging::archive' class.
......................................................................


Remove 'eventlogging::archive' class.

This patch removes the 'eventlogging::archive' class. The log file hierarchy
/var/log and the logrotate config were moved to module's eponymous init class
and the rsync server module was delegated to the role class.

Change-Id: I4134ab8aa5b278d6b17fc8f1589da14440ed126b
---
M manifests/role/eventlogging.pp
D modules/eventlogging/manifests/archive.pp
M modules/eventlogging/manifests/init.pp
3 files changed, 26 insertions(+), 31 deletions(-)

Approvals:
  Faidon: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/eventlogging.pp b/manifests/role/eventlogging.pp
index 1c21b2c..dd18568 100644
--- a/manifests/role/eventlogging.pp
+++ b/manifests/role/eventlogging.pp
@@ -137,12 +137,20 @@
             output => 'file:///var/log/eventlogging/all-events.log';
     }
 
-    $archive_destinations = $::realm ? {
+    $backup_destinations = $::realm ? {
         production => [ 'stat1.wikimedia.org', 'stat1002.eqiad.wmnet' ],
-        labs       => [],
+        labs       => false,
     }
 
-    class { 'eventlogging::archive':
-        destinations => $archive_destinations,
+    if ( $backup_destinations ) {
+        include rsync::server
+
+        rsync::server::module { 'eventlogging':
+            path        => '/var/log/eventlogging',
+            read_only   => 'yes',
+            list        => 'yes',
+            require     => File['/var/log/eventlogging'],
+            hosts_allow => $backup_destinations,
+        }
     }
 }
diff --git a/modules/eventlogging/manifests/archive.pp 
b/modules/eventlogging/manifests/archive.pp
deleted file mode 100644
index fdcf7b2..0000000
--- a/modules/eventlogging/manifests/archive.pp
+++ /dev/null
@@ -1,27 +0,0 @@
-# Configures node to rotate event logs and serve archived logs via rsync
-class eventlogging::archive( $destinations ) {
-
-    include rsync::server
-
-    file { [ '/var/log/eventlogging', '/var/log/eventlogging/archive' ]:
-        ensure  => directory,
-        owner   => 'eventlogging',
-        group   => 'wikidev',
-        mode    => '0664',
-    }
-
-    rsync::server::module { 'eventlogging':
-        path        => '/var/log/eventlogging',
-        read_only   => 'yes',
-        list        => 'yes',
-        require     => File['/var/log/eventlogging'],
-        hosts_allow => $destinations,
-    }
-
-    file { '/etc/logrotate.d/eventlogging':
-        source  => 'puppet:///modules/eventlogging/logrotate',
-        require => File['/var/log/eventlogging/archive'],
-        mode    => '0444',
-    }
-
-}
diff --git a/modules/eventlogging/manifests/init.pp 
b/modules/eventlogging/manifests/init.pp
index 73e9d2e..a4a4e62 100644
--- a/modules/eventlogging/manifests/init.pp
+++ b/modules/eventlogging/manifests/init.pp
@@ -93,4 +93,18 @@
     file { '/usr/local/lib/eventlogging':
         ensure => directory,
     }
+
+    # Logs are collected in </var/log/eventlogging> and rotated daily.
+    file { [ '/var/log/eventlogging', '/var/log/eventlogging/archive' ]:
+        ensure  => directory,
+        owner   => 'eventlogging',
+        group   => 'eventlogging',
+        mode    => '0664',
+    }
+
+    file { '/etc/logrotate.d/eventlogging':
+        source  => 'puppet:///modules/eventlogging/logrotate',
+        require => File['/var/log/eventlogging/archive'],
+        mode    => '0444',
+    }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/74562
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4134ab8aa5b278d6b17fc8f1589da14440ed126b
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Faidon <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to