lablabs.nexus_config

Sonatype Nexus Repository Manager Configuration

Galaxy Quality Role version Role downloads molecule lint License

This Ansible role helps set up the Sonatype Nexus Repository Manager using its REST API.

Features Covered:

  • Set up initial admin password
  • Create users
  • Update users
  • Delete users
  • Create blob storage (files)
  • Update blob storage (files)
  • Delete blob storage (files)
  • Create blob storage (AWS S3)
  • Update blob storage (AWS S3)
  • Delete blob storage (AWS S3)
  • Create blob storage (Azure)
  • Update blob storage (Azure)
  • Delete blob storage (Azure)
  • Create repositories (Maven, Docker, PyPi, Conda, R, npm)
  • Update repositories (Maven, Docker, PyPi, Conda, R, npm)
  • Delete repositories (Maven, Docker, PyPi, Conda, R, npm)
  • Create roles
  • Update roles
  • Delete roles
  • TBD ...

Requirements

Ansible version 2.10 or higher.

Role Variables

These are the default configuration values from defaults/main.yml

---

# Admin username
admin_username: admin

# Initial Nexus admin password
initial_admin_password: admin123

# Admin password during setup
admin_password: "{{ lookup('env', 'ADMIN_PASSWORD') }}"

# Nexus API host
api_host: localhost

# Nexus API port
api_port: 8081

# Protocol for Nexus API
api_protocol: http

# Path to root CA .pem file for custom SSL (if using HTTPS)
root_ca:

# Hide sensitive info in Ansible error logs
hide_sensitive_logs: true

# Enable anonymous access
anonymous_access: true

users: []  # Configure user details here

roles: []  # Configure role details here

stores: []  # Configure blob storage details here

repositories: []  # Configure repository details here

Example Playbook

This sample playbook creates two users and one blob storage.

---
- name: Configure Nexus
  hosts: all
  user: ansible
  become: yes
  vars:
    config:
      users:
        - id: joan
          first_name: Joan
          last_name: Doe
          email: [email protected]
          password: "{{ lookup('env', 'JOAN_PASSWORD') }}"
          status: active
          source: default
          roles:
            - nx-admin
        - id: joe
          first_name: Joe
          last_name: Doe
          email: [email protected]
          password: nbusr123
          status: disabled
          source: default
          roles:
            - nx-anonymous
      stores:
        - name: file_blob
          type: file
          soft_quota: 0
          path: /mydata/blobs
          status: active
  roles:
    - role: lablabs.nexus_config

License

License

Refer to the LICENSE file for complete details.

This work is licensed under the Apache License 2.0. You can find the complete license here.

Author Information

Created in 2021 by Labyrinth Labs

Informazioni sul progetto

Configure Sonatype Nexus Repository Manager

Installa
ansible-galaxy install lablabs.nexus_config
Licenza
apache-2.0
Download
95
Proprietario