Version information
This version is compatible with:
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'hubspot-nexus', '1.7.3'
Learn more about managing modules with a PuppetfileDocumentation
Sonatype Nexus Puppet module
Install and configure Sonatype Nexus.
Requires
- maestrodev/wget
- puppetlabs/stdlib
Usage
The following is a basic role class for building a nexus host. Adjust accordingly as needed.
NOTE: you must pass version to Class['nexus']. This is needed for the download link and determining the name of the nexus directory.
class role_nexus_server {
# puppetlabs-java
# NOTE: Nexus requires
class{ '::java': }
class{ '::nexus':
version => '2.8.0',
revision => '05',
nexus_root => '/srv', # All directories and files will be relative to this
}
Class['::java'] ->
Class['::nexus']
}
NOTE: If you wish to deploy a Nexus Pro server instead of Nexus OSS set
deploy_pro => true
Usage(draft): Nexus 3 support
class role_nexus_server {
class{ '::nexus':
version => '3.0.0',
revision => '03',
download_site => 'http://download.sonatype.com/nexus/3',
nexus_type => 'unix',
nexus_work_dir_manage => false
}
}
NOTE: If you wish to use Nexus 3, nexus_work_dir_manage
need to be set to false
because this module support only Nexus 3 installation
Nginx proxy
The following is setup for using the jfryman/puppet-nginx module. Nexus does not adequately support HTTP and HTTPS simultaneously. Below forces all connections to HTTPS. Be sure to login after the app is up and head to Administration -> Server. Change the base URL to "https" and check "Force Base URL". The application will be available at:
https://${::fqdn}/nexus/
class{ '::nginx': }
file { '/etc/nginx/conf.d/default.conf':
ensure => absent,
require => Class['::nginx::package'],
notify => Class['::nginx::service']
}
nginx::resource::vhost { 'nexus':
ensure => present,
www_root => '/usr/share/nginx/html',
rewrite_to_https => true,
ssl => true,
ssl_cert => '/etc/pki/tls/certs/server.crt',
ssl_key => '/etc/pki/tls/private/server.key',
}
nginx::resource::location { 'nexus':
ensure => present,
location => '/nexus',
vhost => 'nexus',
proxy => "http://${nexus_host}:${nexus_port}/nexus",
ssl => true,
}
TODO
- Find a way to not require a version to be passed to Class['nexus']
Authors
- Tom McLaughlin tmclaughlin@hubspot.com
Copyright
Hubspot, Inc.
puppet-nexus
1.7.1
- Support for validating the md5 checksum of the Nexus package file. https://github.com/hubspotdevops/puppet-nexus/pull/80
1.7.0
- Support for CentOS and RedHat versions using systemd: https://github.com/hubspotdevops/puppet-nexus/pull/76
1.6.1
- Support for older versions of Ubuntu: https://github.com/hubspotdevops/puppet-nexus/pull/70
1.6.0
- Support for Ubuntu https://github.com/hubspotdevops/puppet-nexus/pull/67
1.5.0
- Support for Puppet 4.5.2 https://github.com/hubspotdevops/puppet-nexus/pull/65
1.4.0
- Support for Nexus 3
- Support for Debian 8
1.3.1
- Fix the location of the Nexus work directory if $nexus_work_dir is not is not passed in.
1.3.0
- Updated download location of package.
- Make $nexus_work_dir configurable instead of using "${nexus_root}/${nexus::params::nexus_work_dir}" (/srv/sonatype-work)
- Make managing owner and perms of $nexus_work_dir configurable.
- installations with large repos can turn this off to prevent overconsumption of resources.
- This has been requested for ages.
- Set 'run_as_user' for service status to $nexus_user. A bug from 2.7 days appears to be gone.
- Add rudimentary spec tests
Dependencies
- puppetlabs/stdlib (>=0.0.0 <5.0.0)
- maestrodev/wget (>=1.0.0 <2.0.0)
The MIT License (MIT) Copyright (c) 2013 HubSpot, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.