Puppet Class: nexus::config::admin

Defined in:
manifests/config/admin.pp

Summary

Manage the nexus repository manager administrator account

Overview

Examples:

include nexus::config::admin

Parameters:

  • username (String[1]) (defaults to: 'admin')

    The username of the administrator.

  • first_name (String[1]) (defaults to: 'Administrator')

    The first name of the administrator.

  • last_name (String[1]) (defaults to: 'User')

    The last name of the administrator.

  • email_address (String[1]) (defaults to: 'admin@example.org')

    The email address of the administrator.

  • roles (Array[String[1]]) (defaults to: ['nx-admin'])

    The assigned roles of the administrator. It should include ‘nx-admin’.

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

    The password of the administrator. If not given there will be generated a random password.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'manifests/config/admin.pp', line 19

class nexus::config::admin (
  String[1] $username = 'admin',
  String[1] $first_name = 'Administrator',
  String[1] $last_name = 'User',
  String[1] $email_address = 'admin@example.org',
  Array[String[1]] $roles = ['nx-admin'],
  Optional[Sensitive[String[1]]] $password = undef,
) {
  if $password {
    $real_password = $password
  } else {
    $real_password = extlib::cache_data('nexus_cache_data', 'admin_password', extlib::random_password(16))
  }

  nexus_user { $username:
    ensure        => 'present',
    first_name    => $first_name,
    last_name     => $last_name,
    password      => $real_password,
    email_address => $email_address,
    roles         => $roles,
  }
}