Forge Home

nexus

Puppet module for Sonatype Nexus

176,156 downloads

63,066 latest version

3.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.7.3 (latest)
  • 1.7.1
  • 1.7.0
  • 1.6.1
  • 1.6.0
  • 1.5.0
  • 1.4.0
  • 1.3.3
  • 1.3.2
  • 1.3.1
  • 1.2.0
  • 1.0.1
released Sep 27th 2013

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'hubspot-nexus', '1.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add hubspot-nexus
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install hubspot-nexus --version 1.0.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: nexus

Documentation

hubspot/nexus — version 1.0.1 Sep 27th 2013

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':
    distribution => 'java-1.7.0-openjdk'
  }

  group{ 'nexus':
    ensure => present,
    system => true
  }

  user{ 'nexus':
    ensure => present,
    comment => 'Nexus user',
    gid     => 'nexus',
    home    => '/srv/nexus',
    shell   => '/bin/bash', # unfortunately required to start application via script.
    system  => true,
    require => Group['nexus']
  }

  class{ '::nexus':
    version        => '2.6.2',
    nexus_user     => 'nexus',
    nexus_group    => 'nexus'
    nexus_root     => '/srv', # All directories and files will be relative to this
  }
  
  Class['::java'] ->
  Group[$nexus_group] ->
  User[$nexus_user] ->
  Class['::nexus'] ->

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

Copyright

Hubspot, Inc.