Compatibility with Solr 5.x - Don't create solr.log file

Issue #29 resolved
Benjamin Delacour created an issue

Hello

Since version 6.0.1 of this project (after the merge of the following issue : https://bitbucket.org/landcareresearch/puppet-solr/issues/21/fix-startup-add-timezone-and-manage-some), an empty solr.log is always created.

The problem is : Solr 5 deletes the solr.log file on service refresh and Puppet will re-create it after each run.

Info: Applying configuration version '...'
Notice: /Stage[main]/Solr::Config/File[/var/log/solr/solr.log]/ensure: created (corrective)
Info: Class[Solr::Config]: Scheduling refresh of Class[Solr::Service]
Info: Class[Solr::Service]: Scheduling refresh of Service[solr]
Notice: /Stage[main]/Solr::Service/Service[solr]: Triggered 'refresh' from 1 event
Notice: Applied catalog in 12.47 seconds

For compatibility purpose, can you add a condition like this

versioncmp($solr::version, '6.0.0') >= 0

just here : https://bitbucket.org/landcareresearch/puppet-solr/src/746f6a871accad78208cc02c50cca687a5a1b232/manifests/config.pp#lines-27 ?

  if versioncmp($solr::version, '6.0.0') >= 0 {
    # create empty solr log file
    file { "${::solr::solr_logs}/solr.log":
      ensure => present,
      owner  => $solr::solr_user,
      group  => $solr::solr_user,
    }
  }

Thank you !

Comments (5)

  1. Michael Speth

    Thank you for your PR. I have accepted and incorporated your changes in version 6.0.10 published on the forge.

  2. Log in to comment