• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    Groovy
  • License
    GNU General Publi...
  • Created about 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ansible role to provision Nexus Repository Manager 3.x for RedHat/CentOS

Ansible Role: Nexus 3 OSS

This role installs and configures Nexus Repository Manager OSS version 3.x on CentOS/RHEL.

All configuration can be updated by re-running the role, except for the blobstores-related settings, which are immutable in nexus.

Requirements

  • This has only been tested on CentOS 7 + Ubuntu 16.04 (Xenial)
  • Oracle Java 8 (mandatory)
  • Apache HTTPD (optional, used to setup a SSL reverse-proxy)

(see Dependencies section below for matching roles on galaxy)

Role Variables

Ansible variables, along with the default values (see default/main.yml) :

nexus_version: '3.1.0-04'
nexus_timezone: 'UTC'
nexus_package: "nexus-{{ nexus_version }}-unix.tar.gz"

The nexus version and package to install, see available versions at https://www.sonatype.com/download-oss-sonatype . nexus_timezone is a Java Timezone name and can be useful in combination with nexus_scheduled_tasks cron expressions below.

nexus_download_dir: '/tmp'

Directory on target where the nexus package will be downloaded.

nexus_default_port: 8081
nexus_default_context_path: '/'

Port and context path of the java nexus process. nexus_default_context_path has to keep the trailing slash when set, for ex. : nexus_default_context_path: '/nexus/'.

nexus_os_group: 'nexus'
nexus_os_user: 'nexus'

User and group used to own the nexus files and run the service, those will be created by the role if absent.

nexus_installation_dir: '/opt'
nexus_data_dir: '/var/nexus'
nexus_tmp_dir: '/tmp/nexus'

Nexus directories, nexus_installation_dir contains the installed executable(s), nexus_data_dir contains all configuration, repositories and uploaded artifacts. Note: custom blobstores paths outside of nexus_data_dir can be configured, see nexus_blobstores below.

nexus_admin_password: 'changeme'

The 'admin' account password to setup. Note : admin password change subsequent to first-time provisioning/install is not implemented by this role yet.

nexus_anonymous_access: false

Allow anonymous access to nexus.

public_hostname: 'nexus.vm'

The fully qualified domain name under which the nexus instance will be accessible to its clients.

nexus_branding_header: ""
nexus_branding_footer: "Last provisionned {{ ansible_date_time.iso8601 }}"

Header and footer branding, those can contain HTML.

httpd_setup_enable: false
httpd_ssl_certificate_file: 'files/nexus.vm.crt'
httpd_ssl_certificate_key_file: 'files/nexus.vm.key'

Setup an SSL Reverse-proxy, this needs httpd installed. Note : when httpd_setup_enable is set to true, nexus binds to 127.0.0.1:8081 thus not being directly accessible on HTTP port 8081 from an external IP.

ldap_connections: []

LDAP connection(s) setup, each item goes as follow :

  - ldap_name: 'My Company LDAP' # used as a key to update the ldap config
    ldap_protocol: 'ldaps' # ldap or ldaps
    ldap_hostname: 'ldap.mycompany.com'
    ldap_port: 636
    ldap_search_base: 'dc=mycompany,dc=net'
    ldap_auth: 'none' # or simple
    ldap_auth_username: 'username' # if auth = simple
    ldap_auth_password: 'password' # if auth = simple
    ldap_user_base_dn: 'ou=users'
    ldap_user_filter: '(cn=*)' # (optional)
    ldap_user_object_class: 'inetOrgPerson'
    ldap_user_id_attribute: 'uid'
    ldap_user_real_name_attribute: 'cn'
    ldap_user_email_attribute: 'mail'
    ldap_user_subtree: false
    ldap_map_groups_as_roles: false
    ldap_group_base_dn: 'ou=groups'
    ldap_group_object_class: 'posixGroup'
    ldap_group_id_attribute: 'cn'
    ldap_group_member_attribute: 'memberUid'
    ldap_group_member_format: '${username}'
    ldap_group_subtree: false

Example LDAP config for anonymous authentication (anonymous bind), this is also the "minimal" config :

  - ldap_name: 'Simplest LDAP config'
    ldap_protocol: 'ldaps'
    ldap_hostname: 'annuaire.mycompany.com'
    ldap_search_base: 'dc=mycompany,dc=net'
    ldap_port: 636
    ldap_user_id_attribute: 'uid'
    ldap_user_real_name_attribute: 'cn'
    ldap_user_email_attribute: 'mail'
    ldap_user_object_class: 'inetOrgPerson'

Example LDAP config for simple authentication (using a DSA account) :

  - ldap_name: 'LDAP config with DSA'
    ldap_protocol: 'ldaps'
    ldap_hostname: 'annuaire.mycompany.com'
    ldap_port: 636
    ldap_auth: 'simple'
    ldap_auth_username: 'cn=mynexus,ou=dsa,dc=mycompany,dc=net'
    ldap_auth_password: "{{ vault_ldap_dsa_password }}" # better keep passwords in an ansible vault
    ldap_search_base: 'dc=mycompany,dc=net'
    ldap_user_base_dn: 'ou=users'
    ldap_user_object_class: 'inetOrgPerson'
    ldap_user_id_attribute: 'uid'
    ldap_user_real_name_attribute: 'cn'
    ldap_user_email_attribute: 'mail'
    ldap_user_subtree: false

Example LDAP config for simple authentication (using a DSA account) + groups mapped as roles :

  - ldap_name: 'LDAP config with DSA'
    ldap_protocol: 'ldaps'
    ldap_hostname: 'annuaire.mycompany.com'
    ldap_port: 636
    ldap_auth: 'simple'
    ldap_auth_username: 'cn=mynexus,ou=dsa,dc=mycompany,dc=net'
    ldap_auth_password: "{{ vault_ldap_dsa_password }}" # better keep passwords in an ansible vault
    ldap_search_base: 'dc=mycompany,dc=net'
    ldap_user_base_dn: 'ou=users'
    ldap_user_object_class: 'inetOrgPerson'
    ldap_user_id_attribute: 'uid'
    ldap_user_real_name_attribute: 'cn'
    ldap_user_email_attribute: 'mail'
    ldap_map_groups_as_roles: true
    ldap_group_base_dn: 'ou=groups'
    ldap_group_object_class: 'groupOfNames'
    ldap_group_id_attribute: 'cn'
    ldap_group_member_attribute: 'member'
    ldap_group_member_format: 'uid=${username},ou=users,dc=mycompany,dc=net'
    ldap_group_subtree: false
nexus_privileges:
  - name: all-repos-read # used as key to update a privilege
    description: 'Read & Browse access to all repos'
    repository: '*'
    actions: # can be add, browse, create, delete, edit, read or  * (all)
      - read
      - browse

List of the privileges to setup. Those items are combined with the following default values :

    _nexus_privilege_defaults:
      type: repository-view
      format: maven2
      actions:
        - read
    nexus_roles:
      - id: Developpers # can map to a LDAP group id, also used as a key to update a role
        name: developers
        description: All developers
        privileges:
          - nx-search-read
          - all-repos-read
        roles: [] # references to other role names

List of the roles to setup.

nexus_local_users: []

Local (non-LDAP) users/accounts to create in nexus, items go as follow :

  - username: jenkins # used as key to update
    first_name: Jenkins
    last_name: CI
    email: [email protected]
    password: "s3cr3t"
    roles:
      - developers # role ID
nexus_delete_default_repos: false

Delete the repositories from the nexus install initial default configuration. This step is only executed on first-time install (when nexus_data_dir has been detected empty).

nexus_delete_default_blobstore: false

Delete the default blobstore from the nexus install initial default configuration. This can be done only if nexus_delete_default_repos: true and all configured repositories (see below) have an explicit blob_store: custom. This step is only executed on first-time install (when nexus_data_dir has been detected empty).

nexus_blobstores: []
# example blobstore item :
# - name: separate-storage
#   path: /mnt/custom/path

Blobstores to create. A blobstore path and a repository blobstore cannot be updated after initial creation (any update here will be ignored on re-provisionning).

nexus_scheduled_tasks: []
#  example task to compact blobstore :
#  - name: compact-blobstore
#    cron: '0 0 22 * * ?'
#    typeId: blobstore.compact
#    taskProperties:
#      blobstoreName: 'default' # all task attributes are stored as strings by nexus internally

Scheduled tasks to setup. typeId and task-specific taskProperties can be guessed either from the java type hierarchy of org.sonatype.nexus.scheduling.TaskDescriptorSupport or from peeking at the browser AJAX requests while manually configuring a task.

nexus_repos_maven_proxy:
  - name: central
    remote_url: 'https://repo1.maven.org/maven2/'
    layout_policy: permissive
  - name: jboss
    remote_url: 'https://repository.jboss.org/nexus/content/groups/public-jboss/'
# example with a login/password :
# - name: secret-remote-repo
#   remote_url: 'https://company.com/repo/secure/private/go/away'
#   remote_username: 'username'
#   remote_password: 'secret'

Maven proxy repositories configuration.

nexus_repos_maven_hosted:
  - name: private-release
    version_policy: release
    write_policy: allow_once

Maven hosted repositories configuration.

nexus_repos_maven_group:
  - name: public
    member_repos:
      - central
      - jboss

Maven group repositories configuration.

All three repository types are combined with the following default values :

    _nexus_repos_maven_defaults:
      blob_store: default # Note : cannot be updated once the repo has been created
      strict_content_validation: true
      version_policy: release # release, snapshot or mixed
      layout_policy: strict # strict or permissive
      write_policy: allow_once # allow_once or allow

Docker, Pypi, Raw, Rubygems, Bower, NPM, and Git-LFS repository types: see defaults/main.yml for these options:

  nexus_config_pypi: false
  nexus_config_docker: false
  nexus_config_raw: false
  nexus_config_rubygems: false
  nexus_config_bower: false
  nexus_config_npm: false
  nexus_config_gitlfs: false

These are all false unless you override them from playbook / group_var / cli, these all utilize the same mechanism as maven.

Dependencies

This role requires Ansible 2.1 or higher.

The java and httpd requirements /can/ be fulfilled with the following galaxy roles :

Example Playbook

---
- name: Nexus
  hosts: nexus
  become: yes

  vars:
    nexus_version: '3.1.0-04'
    nexus_timezone: 'Canada/Eastern'
    nexus_admin_password: "{{ vault_nexus_admin_password }}"
    httpd_server_name: 'nexus.vm'
    httpd_setup_enable: true
    httpd_ssl_certificate_file: "{{ vault_httpd_ssl_certificate_file }}"
    httpd_ssl_certificate_key_file: "{{ vault_httpd_ssl_certificate_key_file }}"
    ldap_connections:
      - ldap_name: 'Company LDAP'
        ldap_protocol: 'ldaps'
        ldap_hostname: 'ldap.company.com'
        ldap_port: 636
        ldap_search_base: 'dc=company,dc=net'
        ldap_user_base_dn: 'ou=users'
        ldap_user_object_class: 'inetOrgPerson'
        ldap_user_id_attribute: 'uid'
        ldap_user_real_name_attribute: 'cn'
        ldap_user_email_attribute: 'mail'
        ldap_group_base_dn: 'ou=groups'
        ldap_group_object_class: 'posixGroup'
        ldap_group_id_attribute: 'cn'
        ldap_group_member_attribute: 'memberUid'
        ldap_group_member_format: '${username}'
    nexus_privileges:
      - name: all-repos-read
        description: 'Read & Browse access to all repos'
        repository: '*'
        actions:
          - read
          - browse
      - name: company-project-deploy
        description: 'Deployments to company-project'
        repository: company-project
        actions:
          - add
          - edit
    nexus_roles:
      - id: Developpers # maps to the LDAP group
        name: developers
        description: All developers
        privileges:
          - nx-search-read
          - all-repos-read
          - company-project-deploy
        roles: []
    nexus_local_users:
      - username: jenkins # used as key to update
        first_name: Jenkins
        last_name: CI
        email: [email protected]
        password: "s3cr3t"
        roles:
          - Developpers # role ID here
    nexus_blobstores:
      - name: company-artifacts
        path: /var/nexus/blobs/company-artifacts
    nexus_scheduled_tasks:
      - name: compact-blobstore
        cron: '0 0 22 * * ?'
        typeId: blobstore.compact
        taskProperties:
          blobstoreName: 'company-artifacts'
    nexus_repos_maven_proxy:
      - name: central
        remote_url: 'https://repo1.maven.org/maven2/'
        layout_policy: permissive
      - name: alfresco
        remote_url: 'https://artifacts.alfresco.com/nexus/content/groups/private/'
        remote_username: 'secret-username'
        remote_password: "{{ vault_alfresco_private_password }}"
      - name: jboss
        remote_url: 'https://repository.jboss.org/nexus/content/groups/public-jboss/'
      - name: vaadin-addons
        remote_url: 'https://maven.vaadin.com/vaadin-addons/'
      - name: jaspersoft
        remote_url: 'https://jaspersoft.artifactoryonline.com/jaspersoft/jaspersoft-repo/'
        version_policy: mixed
    nexus_repos_maven_hosted:
      - name: company-project
        version_policy: mixed
        write_policy: allow
        blob_store: company-artifacts
    nexus_repos_maven_group:
      - name: public
        member_repos:
          - central
          - jboss
          - vaadin-addons
          - jaspersoft

  roles:
    - role: ansiblebit.oracle-java
      oracle_java_set_as_default: yes
    - role: geerlingguy.apache
      apache_create_vhosts: no
    - role: savoirfairelinux.nexus3-oss

License

GNU GPLv3

Author Information

See https://github.com/savoirfairelinux/ansible-nexus3-oss

More Repositories

1

opendht

OpenDHT: a C++17 Distributed Hash Table implementation
C++
1,024
star
2

num2words

Modules to convert numbers to words. 42 --> forty-two
Python
785
star
3

jami-project

This (mirror) repo groups all parts of Jami.
Shell
182
star
4

jami-daemon

Mirror of Gerrit Jami Core Library and Daemon
C++
142
star
5

jami-client-android

Mirror of Gerrit Jami Android Client
Kotlin
138
star
6

jami-client-gnome

Mirror of Gerrit Jami GNOME Client
C++
74
star
7

sous-chef

Sous-Chef is a web application to help organizations to plan and deliver meals, and to manage clients files.
Python
66
star
8

cqfd

cqfd helps running commands inside the Docker container configured for your project, keeping the user and working directory the same inside the container
Shell
65
star
9

sflvault

The networked credentials store and authentication manager
Python
60
star
10

jami-libclient

Mirror of Gerrit Jami Libclient (formerly LibRingClient, or LRC for short) Library
C++
31
star
11

cukinia

A simple on-target system test framework for Linux
Shell
30
star
12

odoo_payroll

Odoo Payroll
Python
28
star
13

monitoring-tools

Collection of monitoring tools for Shinken, Nagios, etc.
Python
28
star
14

jami-client-windows

Mirror of Gerrit Jami Windows Client
C++
25
star
15

meta-embedded-containers

Provide two approaches to embed Docker container(s) into a target root filesystem with Yocto. The Docker images will be pulled from an external Docker registry.
BitBake
21
star
16

jami-client-macos

Mirror of Gerrit Jami macOS Client
Objective-C++
20
star
17

jami-client-ios

Mirror of Gerrit Jami iOS Client
Swift
17
star
18

ansible-django

Provisions a Django project behind nginx/uwsgi
Shell
16
star
19

ansible-reboot-if-needed

Reboots hosts if needed, pausing for confirmation
14
star
20

flake8-copyright

Adds copyright checks to flake8
Python
14
star
21

mod-influxdb

Shinken module for exporting data to InfluxDB
Python
13
star
22

project-addons

Odoo project related addons
Python
11
star
23

ansible-gitpush-deploy

Shell
10
star
24

odoo-cms-theme-exploration

An exploration of theme for odoo-cms with bootflat for Odoo
JavaScript
10
star
25

ansible-puma-rbenv-nginx

Deploy a Ruby rbenv environment with Puma and Nginx virtual host all-in-one.
Shell
9
star
26

django-vagrant-demo

Showcase of a Django project automatically deploying itself locally with Vagrant
JavaScript
8
star
27

training-odoo

Training doc
8
star
28

jami-client-qt

C++
8
star
29

flashlight-search

An instanceable and customizable search portlet for Liferay 7
Java
7
star
30

ansible-php-fpm-nginx

7
star
31

openerp-pyui

Generate OpenERP XML views through a Python API
Python
7
star
32

jami-nameservice

Mirror of Gerrit jami-nameserver project
JavaScript
7
star
33

redmine-add-ldap-user-to-group

Automatically add newly logged-in LDAP user to a specific group.
Ruby
7
star
34

ansible-nginx

Installs and globally configures nginx
6
star
35

meta-jami

BitBake
6
star
36

office-365-integration

Office365 integration for Liferay gives an out of the box access to use the msgraph-sdk from your own Liferay plugin. This includes the ability to let your user login to Microsoft with Auth0.
Java
6
star
37

drupal-monitoring

Containers stack for the Bansho drupal module
Python
5
star
38

vanilla-slick

Soon! The vanilla JavaScript version of the last carousel you'll ever need!
JavaScript
5
star
39

jami-client-uwp

Mirror of Gerrit Jami UWP Client
C++
5
star
40

ringme.js

A library to display a « Ring Me » button on a website.
JavaScript
5
star
41

redmine-issue-status-auto-open

Redmine Plugin : When someone spent time on a task, automatically switch it's status to open if the current status order is below.
Ruby
5
star
42

secure-odoo

Secure Odoo
Python
4
star
43

colorlogging

Simple color logging for Python.
Python
4
star
44

dhtnet

Mirror
C++
4
star
45

redmine-timebank

Show a table with summation total of spent and estimated hours, story points, remaining and projected in version pages.
Ruby
4
star
46

mod-booster-snmp

Shinken module for boosting SNMP connections
Python
3
star
47

quick-phone_ts-tpc-7990

Uses Yocto to build an image which runs quick-phone on the TS-TPC-7990
Shell
3
star
48

redmine-list-of-roles-members

Redmine Plugin : Easily get a list of all members of a Role grouped by projects.
HTML
3
star
49

ansible-uwsgi-nginx

This Ansible role will install uWSGI as needed from official repositories, create NGINX virtual host, manage apps with theirs UNIX sockets + ensure that required plugins are installed.
3
star
50

meta-jami-imx-toradex

BitBake
2
star
51

ansible-ssh-access

Facilitates SSH access from one remote to other(s)
2
star
52

lightweight-liferay-theme

An example of a lightweight liferay theme
FreeMarker
2
star
53

liferay-theme-switcher

A theme switcher module for Liferay 7
Java
2
star
54

odoo-env

A Docker image for Odoo development
2
star
55

starlight

Cross-functional skill tracking system for Agile teams. 🌟
Python
2
star
56

ansible-sync-cron

Provisions crontab entries allowing to rsync folders.
2
star
57

multi-redmine

Installs and configure Redmine from it Git repo, needs rbenv environment.
2
star
58

quick-phone

QML
2
star
59

sflphone

The free software enterprise-class softphone for GNU/Linux
2
star
60

meta-jami-imx

2
star
61

ansible-ansible-install

Installs ansible on the target host, possibly in a virtualenv
2
star
62

connector-rt

Connector between Odoo and Request Tracker (https://www.bestpractical.com/rt/)
2
star
63

pack-vmware-system-https

Checks for VMware virtual machine and ESX/ESXi
2
star
64

redmine-role-members-batch-copy

Copy or move in batch the members of a role to another role in all projects.
HTML
2
star
65

redmine-subtask-overview-enhanced

Show time spent and estimated time of each tasks into the subtasks overview of a task page.
Ruby
2
star
66

jmeter-openstack

JMeter OpenStack, easily develop performance tests for OpenStack
Java
2
star
67

odoo-ci

Odoo image to do CI of our public modules.
Dockerfile
1
star
68

ansible-compile-website

Ansible role that crawl sitemap URLs pages in order to fill all the caches.
1
star
69

oe-sfl

BitBake
1
star
70

lampd

A Drupal-oriented LAMP stack base image for Docker, based on Phusion
Dockerfile
1
star
71

pack-linux-system-nrpe

1
star
72

sflphone-test

1
star
73

ansible-postgres-install

Installs postgresql server on debian jessie
1
star
74

odoo-sh-sfl

1
star
75

pack-generic-repodeb-http

Debian and Ubuntu repository active checks with HTTP requests
1
star
76

mattermost_bot_poc

A Mattermost bot POC to explore the possibilities (yet another hello world project)
Python
1
star
77

ansible-django-deploy

Ansible role to set up a Django project in a non-privileged environment.
Jinja
1
star
78

WAQ2017-exercices-react.js

Repo des exercices de la présentation https://savoirfairelinux.github.io/WAQ2017-react.js
JavaScript
1
star
79

angular-application-example

Angular Application Example
HTML
1
star
80

angular-ringme.js

Angular component for Ringme.js (https://github.com/savoirfairelinux/ringme.js)
1
star
81

pack-generic-radius

Generic pack for radius check
1
star
82

pack-generic-redis

Shinken pack for redis server
1
star
83

ansible-redmine

Installs and globally configures Redmine in a secure way.
1
star
84

mod-carbon

Python
1
star
85

openerp-sane

Small utilities to ease OpenERP development
Python
1
star
86

hr-addons

HR related Odoo addons
Python
1
star
87

OpenERP-sentry-patch

Patch for setting up OpenERP to work with sentry for Exception reporting
1
star
88

test-report-pdf

Generate a cukinia test report with AsciiDoc
Python
1
star
89

pack-generic-multisite-http

CheckMK Multisite active checks with HTTP requests
1
star
90

ansible-fail2ban

Easily edit and deploy simple Fail2ban service into your server on the fly with easy configuration.
1
star
91

fabmob

Répertoire des contributions faites dans le cadre de la Fabrique de mobilité
Python
1
star
92

node-server-example

Node Server Example
JavaScript
1
star
93

ossec-decoders-and-rules

OSSEC customs decoders and rules for various applications that are not in the default OSSEC
Python
1
star
94

PiKake

Remote controlled dashboard for the minix neo Z64
Python
1
star
95

web-addons

Web related addons
JavaScript
1
star
96

ansible-backup-cron

Shell
1
star
97

pack-generic-smb

Pack to monitor samba shared directory
1
star
98

stock-addons

Odoo stock related addons
Python
1
star
99

pack-generic-ssh

SSH active checks with SSH request
1
star
100

pack-generic-ldap

LDAP active checks with LDAP requests
1
star