]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Add logrotate
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 10 Aug 2016 20:10:25 +0000 (22:10 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 10 Aug 2016 20:21:41 +0000 (22:21 +0200)
.gitmodules
modules/base_configuration/manifests/init.pp
modules/logrotate [new submodule]

index 5310ea7f0bcfcd7852c07358b0709d9599a0cd91..22459fc4a88fc95379846429555b7559878d8df9 100644 (file)
@@ -22,3 +22,6 @@
 [submodule "modules/fail2ban"]
        path = modules/fail2ban
        url = git://git.immae.eu/github/lelutin/puppet-fail2ban
+[submodule "modules/logrotate"]
+       path = modules/logrotate
+       url = git://git.immae.eu/github/yo61/puppet-logrotate.git
index f432e293b0f6d2c142bb792d36e83a2e3d6a58d1..2b20a0e89908e0aabc688d5690a8eaa1ea271dfb 100644 (file)
@@ -59,6 +59,39 @@ class base_configuration (
     include => '/etc/pacman.d/mirrorlist'
   }
 
+  class { '::logrotate':
+    manage_cron_daily => false,
+    config => {
+      rotate_every => 'week',
+      rotate       => 4,
+      create       => true,
+      compress     => true,
+      olddir       => '/var/log/old',
+      tabooext     => "+ .pacorig .pacnew .pacsave",
+    }
+  }
+
+  logrotate::rule { 'wtmp':
+    path         => '/var/log/wtmp',
+    rotate_every => 'month',
+    create       => true,
+    create_mode  => '0664',
+    create_owner => 'root',
+    create_group => 'utmp',
+    rotate       => '1',
+    minsize      => '1M',
+  }
+  logrotate::rule { 'btmp':
+    path         => '/var/log/btmp',
+    missingok    => true,
+    rotate_every => 'month',
+    create       => true,
+    create_mode  => '0600',
+    create_owner => 'root',
+    create_group => 'utmp',
+    rotate       => '1',
+  }
+
   ensure_packages(["whois"], { 'install_options' => '--asdeps' })
   class { 'fail2ban':
     logtarget => 'SYSLOG',
diff --git a/modules/logrotate b/modules/logrotate
new file mode 160000 (submodule)
index 0000000..ad87cf8
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit ad87cf8b589d60bdbd1bb6e9059a5bf742235ec3