Skip to content

Commit

Permalink
Update Puppet module for Puppet Server 5.1.0
Browse files Browse the repository at this point in the history
This patch updates the Puppet module used to install the Clojure file server
to make use of the new JAR directory added to Puppet Server 5.1.0. Installation
is now much cleaner and doesn't require hacking the classpath used by the
init scripts.

Ref: https://tickets.puppetlabs.com/browse/SERVER-249
  • Loading branch information
Sharpie committed Sep 24, 2017
1 parent e7e1004 commit 7d2306f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 29 additions & 15 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
}
}
}

0 comments on commit 7d2306f

Please sign in to comment.