diff --git a/CHANGELOG.md b/CHANGELOG.md index d6dd106..35d2b12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Fixed + + - Puppet module is now compatible with PE 2017.3.0 and uses the + extension JAR directory added to Puppet Server 5.1.0 in SERVER-249. + ## [0.2.0] - 2017-09-24 ### Added diff --git a/manifests/init.pp b/manifests/init.pp index 318e8e6..a5e010f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -30,21 +30,35 @@ notify => Exec['pe-puppetserver service full restart'], } - file {'/opt/puppetlabs/server/apps/puppetserver/clj-file-server.jar': - ensure => file, - owner => 'root', - group => 'root', - mode => '0644', - source => 'puppet:///modules/clj_file_server/clj-file-server.jar', - notify => Exec['pe-puppetserver service full restart'], - } + if versioncmp($::facts['pe_server_version'], '2017.3.0') >= 0 { + # Use the new JAR directory added to Puppet Server 5.1.0 that + # is on the classpath by default (SERVER-249). + file {'/opt/puppetlabs/server/data/puppetserver/jars/clj-file-server.jar': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + source => 'puppet:///modules/clj_file_server/clj-file-server.jar', + notify => Exec['pe-puppetserver service full restart'], + } + } else { + # For older versions, patch the JAR into the classpath. + file {'/opt/puppetlabs/server/apps/puppetserver/clj-file-server.jar': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + source => 'puppet:///modules/clj_file_server/clj-file-server.jar', + notify => Exec['pe-puppetserver service full restart'], + } - file_line {'add file server JAR to classpath': - ensure => present, - path => '/opt/puppetlabs/server/apps/puppetserver/cli/apps/start', - match => '^\s*-cp', - line => ' -cp ${INSTALL_DIR}/puppet-server-release.jar:${INSTALL_DIR}/clj-file-server.jar \\', - replace => true, - notify => Exec['pe-puppetserver service full restart'], + file_line {'add file server JAR to classpath': + ensure => present, + path => '/opt/puppetlabs/server/apps/puppetserver/cli/apps/start', + match => '^\s*-cp', + line => ' -cp ${INSTALL_DIR}/puppet-server-release.jar:${INSTALL_DIR}/clj-file-server.jar \\', + replace => true, + notify => Exec['pe-puppetserver service full restart'], + } } }