Puppet Class: nexus

Defined in:
manifests/init.pp

Summary

Install and configure Sonatype Nexus Repository Manager 3.

Overview

Examples:

class{ 'nexus':
  version => '3.37.3-02',
}

Parameters:

  • download_folder (Stdlib::Absolutepath)

    Destination folder of the downloaded archive.

  • download_site (Stdlib::HTTPUrl)

    Download uri which will be appended with filename of the archive to download.

  • install_root (Stdlib::Absolutepath)

    The root filesystem path where the downloaded archive will be extracted to.

  • work_dir (Stdlib::Absolutepath)

    The nexus repository manager working directory which contains the embedded database and local blobstores.

  • user (String[1])

    The operation system user used to start the nexus repository manager service.

  • group (String[1])

    The operation system group used to start the nexus repository manager service.

  • host (Stdlib::Host)

    The bind address where the nexus repository manager service should bind to.

  • port (Stdlib::Port)

    The port which the nexus repository manager service should use.

  • manage_api_resources (Boolean)

    Set if this module should manage resources which require to be set over the nexus repository manager rest api.

  • manage_config (Boolean)

    Set if this module should manage the config file of nexus repository manager.

  • manage_user (Boolean)

    Set if this module should manage the creation of the operation system user.

  • manage_work_dir (Boolean)

    Set if this module should manage the work directory of the nexus repository manager.

  • manage_datastore (Boolean)

    Set if this module should manage datastore - Note that you need a licence for postgresql backend

  • purge_installations (Boolean)

    Set this option if you want old installations of nexus repository manager to get automatically deleted.

  • purge_default_repositories (Boolean)

    Set this option if you want to remove the default created maven and nuget repositories.

  • package_type (Enum['src', 'pkg'])

    Select ‘src’ for Source download & install. ‘pkg’ will fetch te specified package and version from repos you must provide.

  • package_ensure (String)
  • download_proxy (Optional[Stdlib::HTTPUrl]) (defaults to: undef)

    Proxyserver address which will be used to download the archive file.

  • version (Optional[Pattern[/3.\d+.\d+-\d+/]]) (defaults to: undef)

    The version to download, install and manage.

  • java_runtime (Optional[Enum['java8', 'java11']]) (defaults to: undef)

    The Java runtime to be utilized. Relevant only for Nexus versions >= 3.67.0-03 and < 3.71.0.

  • package_name (Optional[String]) (defaults to: undef)

    The name of the package to install. Default ‘nexus’

  • postgresql_username (Optional[String[1]]) (defaults to: undef)

    Postgresql Username - Only available in Sonatype Nexus Repository Pro

  • postgresql_password (Optional[String[1]]) (defaults to: undef)

    Postgresql Password - Only available in Sonatype Nexus Repository Pro

  • postgresql_jdbcurl (Optional[String[1]]) (defaults to: undef)

    Postgresql jdbcUrl. Formatted as jdbc:postgresql://<database-host>:<database-port>/nexus Only available in Sonatype Nexus Repository Pro

See Also:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'manifests/init.pp', line 62

class nexus (
  Stdlib::Absolutepath $download_folder,
  Stdlib::HTTPUrl $download_site,
  Stdlib::Absolutepath $install_root,
  Stdlib::Absolutepath $work_dir,
  String[1] $user,
  String[1] $group,
  Stdlib::Host $host,
  Stdlib::Port $port,
  Boolean $manage_api_resources,
  Boolean $manage_config,
  Boolean $manage_user,
  Boolean $manage_work_dir,
  Boolean $manage_datastore,
  Boolean $purge_installations,
  Boolean $purge_default_repositories,
  Enum['src', 'pkg'] $package_type,
  String $package_ensure,
  Optional[Stdlib::HTTPUrl] $download_proxy = undef,
  Optional[Pattern[/3.\d+.\d+-\d+/]] $version = undef,
  Optional[Enum['java8', 'java11']] $java_runtime = undef,
  Optional[String] $package_name = undef,
  Optional[String[1]] $postgresql_username = undef,
  Optional[String[1]] $postgresql_password = undef,
  Optional[String[1]] $postgresql_jdbcurl = undef,
) {
  include stdlib

  if ($version and versioncmp($version, '3.67.0-03') >= 0 and versioncmp($version, '3.71.0') < 0 and ! $java_runtime) {
    fail('You need to define the $java_runtime parameter for nexus version >= 3.67.0-03 and < 3.71.0')
  }

  contain nexus::user
  contain nexus::package

  if $manage_config {
    contain nexus::config

    Class['nexus::package'] -> Class['nexus::config::properties'] ~> Class['nexus::service']
  }

  contain nexus::service

  Class['nexus::user'] -> Class['nexus::package'] ~> Class['nexus::service']

  Class['nexus::service']
  -> Nexus_user <| |>
  -> Nexus_setting <| |>
  -> Nexus_blobstore <| ensure == 'present' |>
  -> Nexus_repository <| |>
  -> Nexus_blobstore <| ensure == 'absent' |>
}