From c7a77efe5bcf31aab67c1b835a793f6f6ff39e91 Mon Sep 17 00:00:00 2001
From: Jeffrey Zhang <zhang.lei.fly@gmail.com>
Date: Thu, 3 Aug 2017 07:50:42 +0800
Subject: [PATCH] Change mode after ceph and neutron log is rotated

Change the log mode to 644 ensure that fluent can read the files.

Change-Id: I5b718b82ac4267ab29425b2859b14e4518e75cf1
Closes-Bug: #1708095
---
 ansible/roles/common/templates/cron-logrotate-ceph.conf.j2    | 4 ++++
 ansible/roles/common/templates/cron-logrotate-neutron.conf.j2 | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/ansible/roles/common/templates/cron-logrotate-ceph.conf.j2 b/ansible/roles/common/templates/cron-logrotate-ceph.conf.j2
index 98ed78aa2b..d54a2ae9d0 100644
--- a/ansible/roles/common/templates/cron-logrotate-ceph.conf.j2
+++ b/ansible/roles/common/templates/cron-logrotate-ceph.conf.j2
@@ -1,3 +1,7 @@
 "/var/log/kolla/ceph/*.log"
 {
+    create 644 root root
+    postrotate
+        chmod 644 /var/log/kolla/ceph/*.log
+    endscript
 }
diff --git a/ansible/roles/common/templates/cron-logrotate-neutron.conf.j2 b/ansible/roles/common/templates/cron-logrotate-neutron.conf.j2
index f4c2268292..1f9683435e 100644
--- a/ansible/roles/common/templates/cron-logrotate-neutron.conf.j2
+++ b/ansible/roles/common/templates/cron-logrotate-neutron.conf.j2
@@ -1,3 +1,6 @@
 "/var/log/kolla/neutron/*.log"
 {
+    postrotate
+        chmod 644 /var/log/kolla/neutron/*.log
+    endscript
 }