From 990860faa6c22c371938f7e6947b9b091f23e512 Mon Sep 17 00:00:00 2001
From: Carson Gee <x@carsongee.com>
Date: Fri, 22 Nov 2013 10:10:29 -0500
Subject: [PATCH] Updated to use COMMON_LOG_DIR

---
 playbooks/roles/haproxy/files/haproxy.logrotate        | 13 -------------
 playbooks/roles/haproxy/files/haproxy.rsyslog          |  4 ----
 playbooks/roles/haproxy/tasks/main.yml                 |  4 ++--
 playbooks/roles/haproxy/templates/haproxy.logrotate.j2 | 13 +++++++++++++
 playbooks/roles/haproxy/templates/haproxy.rsyslog.j2   |  4 ++++
 5 files changed, 19 insertions(+), 19 deletions(-)
 delete mode 100644 playbooks/roles/haproxy/files/haproxy.logrotate
 delete mode 100644 playbooks/roles/haproxy/files/haproxy.rsyslog
 create mode 100644 playbooks/roles/haproxy/templates/haproxy.logrotate.j2
 create mode 100644 playbooks/roles/haproxy/templates/haproxy.rsyslog.j2

diff --git a/playbooks/roles/haproxy/files/haproxy.logrotate b/playbooks/roles/haproxy/files/haproxy.logrotate
deleted file mode 100644
index 56ddc74..0000000
--- a/playbooks/roles/haproxy/files/haproxy.logrotate
+++ /dev/null
@@ -1,13 +0,0 @@
-/var/log/haproxy/*.log {
-		weekly
-		missingok
-		rotate 7
-		compress
-		delaycompress
-		notifempty
-		create 640 root adm
-		sharedscripts
-		postrotate
-		/etc/init.d/haproxy reload > /dev/null
-		endscript
-}
diff --git a/playbooks/roles/haproxy/files/haproxy.rsyslog b/playbooks/roles/haproxy/files/haproxy.rsyslog
deleted file mode 100644
index 6e0f2af..0000000
--- a/playbooks/roles/haproxy/files/haproxy.rsyslog
+++ /dev/null
@@ -1,4 +0,0 @@
-if ($programname == 'haproxy' and $syslogseverity-text == 'info') then -/var/log/haproxy/haproxy-info.log
-& ~
-if ($programname == 'haproxy' and $syslogseverity-text == 'notice') then -/var/log/haproxy/haproxy-notice.log
-& ~
diff --git a/playbooks/roles/haproxy/tasks/main.yml b/playbooks/roles/haproxy/tasks/main.yml
index a75cfbf..9c245b7 100644
--- a/playbooks/roles/haproxy/tasks/main.yml
+++ b/playbooks/roles/haproxy/tasks/main.yml
@@ -32,10 +32,10 @@
   notify: haproxy | restart haproxy
 
 - name: haproxy | install logrotate
-  copy: src=haproxy.logrotate dest=/etc/logrotate.d/haproxy mode=0644
+  template: src=haproxy.logrotate.j2 dest=/etc/logrotate.d/haproxy mode=0644
 
 - name: haproxy | install rsyslog conf
-  copy: src=haproxy.rsyslog dest=/etc/rsyslog.d/haproxy.conf mode=0644
+  template: src=haproxy.rsyslog.j2 dest=/etc/rsyslog.d/haproxy.conf mode=0644
   notify: haproxy | restart rsyslog
 
 - name: haproxy | make sure haproxy has started
diff --git a/playbooks/roles/haproxy/templates/haproxy.logrotate.j2 b/playbooks/roles/haproxy/templates/haproxy.logrotate.j2
new file mode 100644
index 0000000..902398b
--- /dev/null
+++ b/playbooks/roles/haproxy/templates/haproxy.logrotate.j2
@@ -0,0 +1,13 @@
+{{ COMMON_LOG_DIR }}/haproxy/*.log {
+		weekly
+		missingok
+		rotate 7
+		compress
+		delaycompress
+		notifempty
+		create 640 root adm
+		sharedscripts
+		postrotate
+		/etc/init.d/haproxy reload > /dev/null
+		endscript
+}
diff --git a/playbooks/roles/haproxy/templates/haproxy.rsyslog.j2 b/playbooks/roles/haproxy/templates/haproxy.rsyslog.j2
new file mode 100644
index 0000000..0fe71b8
--- /dev/null
+++ b/playbooks/roles/haproxy/templates/haproxy.rsyslog.j2
@@ -0,0 +1,4 @@
+if ($programname == 'haproxy' and $syslogseverity-text == 'info') then -{{ COMMON_LOG_DIR }}/haproxy/haproxy-info.log
+& ~
+if ($programname == 'haproxy' and $syslogseverity-text == 'notice') then -{{ COMMON_LOG_DIR }}/haproxy/haproxy-notice.log
+& ~
--
libgit2 0.26.0