Bug 1299331

Summary: playbook should configure logrotate on containerized env
Product: OpenShift Container Platform Reporter: Ma xiaoqiang <xiama>
Component: InstallerAssignee: Andrew Butcher <abutcher>
Status: CLOSED ERRATA QA Contact: Ma xiaoqiang <xiama>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: abutcher, aos-bugs, bleanhar, jokerman, mmccomas, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 16:37:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ma xiaoqiang 2016-01-18 07:03:11 UTC
Description of problem:
playbook should configure logrotate on containerized env


Version-Release number of selected component (if applicable):
openshift-ansible-3.0.33-1.git.0.bb1f8aa.el7aos.noarch

How reproducible:
always

Steps to Reproduce:
1. Install containerized environment on rhel7 or atomic with logrotate
this plugin is enable by default. 

2.check the logrotate package
rpm -q logrotate


Actual results:
The package is not installed on rhel


Expected results:
The package is installed on rhel. 

Additional info:
The package is installed on Atomic, so playbook should not skip configuring logrotate on containerized env

Comment 1 Andrew Butcher 2016-01-28 21:52:21 UTC
Proposed fix: https://github.com/openshift/openshift-ansible/pull/1288

The "logrotate_scripts" inventory variable is not set by default so no logrotate scripts will be configured by default. An example "logrotate_scripts" has been added to the byo example inventories.

The logrotate role will be applied to RHEL and Atomic containerized environments.

Comment 2 Ma xiaoqiang 2016-01-29 05:06:02 UTC
Check on openshift-ansible -b master

1. install environment on rhel7 and atomic
#vim hosts
<--snip-->
logrotate_scripts=[{"name": "syslog", "path": "/var/log/cron\n/var/log/maillog\n/var/log/messages\n/var/log/secure\n/var/log/spooler\n", "options": ["daily", "rotate 7", "compress", "sharedscripts", "missingok"], "scripts": {"postrotate": "/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true"}}]
<--[snip-->

ansible will configure logrotate by default.

# cat /etc/logrotate.d/syslog 
# Ansible managed: /home/slave10/workspace/Launch_Environment/workdir/BJ-113-f22-10-0/openshift-ansible/playbooks/common/openshift-node/roles/nickhammond.logrotate/templates/logrotate.d.j2 modified on 2016-01-29 03:08:24 by slave10 on host-192-168-0-188

/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
 {
  daily
  rotate 7
  compress
  sharedscripts
  missingok
  postrotate
    /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
  endscript
  }

Move this issue to VERIFIED

Comment 4 errata-xmlrpc 2016-05-12 16:37:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1065