Skip to content

Commit

Permalink
Update Nexus admin configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
zipkid committed Dec 6, 2023
1 parent e06d616 commit 27f649e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
7 changes: 7 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ nexus::purge_installations: true
nexus::purge_default_repositories: false
nexus::user: nexus
nexus::work_dir: "%{lookup('nexus::install_root')}/sonatype-work/nexus3"

nexus::admin_username: null
nexus::admin_first_name: null
nexus::admin_last_name: null
nexus::admin_email_address: null
nexus::admin_roles: null
nexus::admin_password: null
9 changes: 8 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
contain nexus::config::properties

if $nexus::manage_api_resources {
contain nexus::config::admin
class { 'nexus::config::admin':
username => $nexus::admin_username,
first_name => $nexus::admin_first_name,
last_name => $nexus::admin_last_name,
email_address => $nexus::admin_email_address,
roles => $nexus::admin_roles,
password => $nexus::admin_password,
}
contain nexus::config::device
contain nexus::config::anonymous
contain nexus::config::email
Expand Down
19 changes: 19 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@
# @param purge_default_repositories
# Set this option if you want to remove the default created maven and nuget repositories.
#
# @param admin_username
# The username of the administrator.
# @param admin_first_name
# The first name of the administrator.
# @param admin_last_name
# The last name of the administrator.
# @param admin_email_address
# The email address of the administrator.
# @param admin_roles
# The assigned roles of the administrator. It should include 'nx-admin'.
# @param admin_password
# The password of the administrator. If not given there will be generated a random password.
#
# @example
# class{ 'nexus':
# version => '3.37.3-02',
Expand All @@ -58,6 +71,12 @@
Boolean $manage_work_dir,
Boolean $purge_installations,
Boolean $purge_default_repositories,
Optional[String[1]] $admin_username,
Optional[String[1]] $admin_first_name,
Optional[String[1]] $admin_last_name,
Optional[String[1]] $admin_email_address,
Optional[Array[String[1]]] $admin_roles,
Optional[Variant[String[1], Sensitive[String[1]]]] $admin_password,
) {
include stdlib

Expand Down

0 comments on commit 27f649e

Please sign in to comment.