From d9686a8142ba18d83d88ded3751db9060b9814ca Mon Sep 17 00:00:00 2001 From: Cosmin Dumitru Date: Mon, 24 Mar 2014 10:41:35 +0100 Subject: [PATCH 1/2] added logrotate to bind log --- bind/config.sls | 10 ++++++++++ bind/files/debian/logrotate_bind | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 bind/files/debian/logrotate_bind diff --git a/bind/config.sls b/bind/config.sls index b6fd090..c0ff2a4 100644 --- a/bind/config.sls +++ b/bind/config.sls @@ -106,6 +106,16 @@ bind_default_zones: - user: root - group: bind - mode: 775 + - template: jinja + + +/etc/logrotate.d/bind9: + file: + - managed + - source: salt://bind/files/debian/logrotate_bind + - user: root + - group: root + {% endif %} {% for key,args in salt['pillar.get']('bind:configured_zones', {}).iteritems() -%} diff --git a/bind/files/debian/logrotate_bind b/bind/files/debian/logrotate_bind new file mode 100644 index 0000000..09eab0b --- /dev/null +++ b/bind/files/debian/logrotate_bind @@ -0,0 +1,10 @@ +/var/log/bind9/query.log { + rotate 7 + daily + missingok + notifempty + sharedscripts + copytruncate + compress + create 0664 bind root +} From 6c02efeca21553837398d13981076d4e8f0b5a7f Mon Sep 17 00:00:00 2001 From: Cosmin Dumitru Date: Mon, 24 Mar 2014 10:44:29 +0100 Subject: [PATCH 2/2] fix for logrotate complaining about insecure permissions --- bind/files/debian/logrotate_bind | 1 + 1 file changed, 1 insertion(+) diff --git a/bind/files/debian/logrotate_bind b/bind/files/debian/logrotate_bind index 09eab0b..9677a5a 100644 --- a/bind/files/debian/logrotate_bind +++ b/bind/files/debian/logrotate_bind @@ -7,4 +7,5 @@ copytruncate compress create 0664 bind root + su }