summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Wienand <iwienand@redhat.com>2018-08-02 09:59:27 +1000
committerIan Wienand <iwienand@redhat.com>2018-08-02 12:44:52 +1000
commit2ebab74d16d5c3e77dad39ca8f4a5d67a002d6a5 (patch)
tree1f18e67ddbb0a81795605fa6aca80719e1109a7d
parentb0af9f4536e4e3603dc2e1919e661537d0751375 (diff)
accessbot logs : add timestamp and rotate
Notes
Notes (review): Code-Review+2: Monty Taylor <mordred@inaugust.com> Code-Review+1: Andreas Jaeger <jaegerandi@gmail.com> Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Workflow+1: Clark Boylan <cboylan@sapwetik.org> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 03 Aug 2018 21:22:03 +0000 Reviewed-on: https://review.openstack.org/588106 Project: openstack-infra/puppet-accessbot Branch: refs/heads/master
-rwxr-xr-xfiles/accessbot.py4
-rw-r--r--manifests/init.pp14
2 files changed, 17 insertions, 1 deletions
diff --git a/files/accessbot.py b/files/accessbot.py
index 6f657a5..aa59b9e 100755
--- a/files/accessbot.py
+++ b/files/accessbot.py
@@ -24,7 +24,9 @@ import sys
24import time 24import time
25import yaml 25import yaml
26 26
27logging.basicConfig(level=logging.DEBUG) 27logging.basicConfig(
28 format='%(asctime)s [%(levelname)s] %(name)s - %(message)s',
29 level=logging.DEBUG)
28 30
29 31
30class SetAccess(irc.client.SimpleIRCClient): 32class SetAccess(irc.client.SimpleIRCClient):
diff --git a/manifests/init.pp b/manifests/init.pp
index a220594..21b6e74 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -57,6 +57,20 @@ class accessbot(
57 require => User['accessbot'], 57 require => User['accessbot'],
58 } 58 }
59 59
60 include ::logrotate
61 logrotate::file { 'accessbot.log':
62 ensure => present,
63 log => '/var/log/accessbot/accessbot.log',
64 options => ['compress',
65 'copytruncate',
66 'delaycompress',
67 'missingok',
68 'rotate 7',
69 'daily',
70 'notifempty',
71 ],
72 }
73
60 file { '/etc/accessbot/accessbot.config': 74 file { '/etc/accessbot/accessbot.config':
61 ensure => present, 75 ensure => present,
62 content => template('accessbot/accessbot.config.erb'), 76 content => template('accessbot/accessbot.config.erb'),