குறியீட்டு அணுகுமுறையாக உள்கட்டமைப்பைப் பயன்படுத்தி Nexus Sonatype ஐ நிறுவுதல் மற்றும் கட்டமைத்தல்

Sonatype Nexus என்பது ஒரு ஒருங்கிணைந்த தளமாகும், இதன் மூலம் டெவலப்பர்கள் Java (Maven) சார்புகள், Docker, Python, Ruby, NPM, Bower images, RPM தொகுப்புகள், gitlfs, Apt, Go, Nuget மற்றும் தங்கள் மென்பொருள் பாதுகாப்பை விநியோகிக்க முடியும்.

உங்களுக்கு ஏன் Sonatype Nexus தேவை?

  • தனிப்பட்ட கலைப்பொருட்களை சேமிப்பதற்காக;
  • இணையத்தில் இருந்து பதிவிறக்கம் செய்யப்பட்ட கலைப்பொருட்களை தேக்குவதற்கு;

அடிப்படை Sonatype Nexus தொகுப்பில் ஆதரிக்கப்படும் கலைப்பொருட்கள்:

  • ஜாவா, மேவன் (ஜாடி)
  • கூலியாள்
  • மலைப்பாம்பு (பைப்)
  • ரூபி (மாணிக்கம்)
  • NPM
  • கொடி பந்தல்
  • யம் (ஆர்பிஎம்)
  • gitlfs
  • ரா
  • ஆப்ட் (டெப்)
  • Go
  • நுஜெட்

சமூக ஆதரவு கலைப்பொருட்கள்:

  • இசையமைப்பாளர்
  • கானன்
  • CPAN
  • ELPA
  • தலைமையில்
  • P2
  • R

Sonatype Nexus ஐப் பயன்படுத்தி நிறுவுதல் https://github.com/ansible-ThoTeam/nexus3-oss

தேவைகள்

  • இணையத்தில் அன்சிபிள் பயன்படுத்துவது பற்றி படிக்கவும்.
  • அன்சிபிள் நிறுவவும் pip install ansible பிளேபுக் இயங்கும் பணிநிலையத்தில்.
  • நிறுவ geerlingguy.java பிளேபுக் இயங்கும் பணிநிலையத்தில்.
  • நிறுவ geerlingguy.apache பிளேபுக் இயங்கும் பணிநிலையத்தில்.
  • இந்த பங்கு CentOS 7, Ubuntu Xenial (16.04) மற்றும் Bionic (18.04), Debian Jessie and Stretch ஆகியவற்றில் சோதிக்கப்பட்டது
  • jmespath பிளேபுக் இயங்கும் பணிநிலையத்தில் நூலகம் நிறுவப்பட வேண்டும். நிறுவுவதற்கு: sudo pip install -r requirements.txt
  • பிளேபுக் கோப்பை (கீழே உள்ள எடுத்துக்காட்டு) nexus.yml கோப்பில் சேமிக்கவும்
  • நெக்ஸஸ் நிறுவலை இயக்கவும் ansible-playbook -i host nexus.yml

Maven (java), Docker, Python, Ruby, NPM, Bower, RPM மற்றும் gitlfs களஞ்சியங்களுடன் LDAP இல்லாமல் நெக்ஸஸை நிறுவுவதற்கான எடுத்துக்காட்டு ansible-playbook.

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

  vars:
    nexus_timezone: 'Asia/Omsk'
    nexus_admin_password: "admin123"
    nexus_public_hostname: 'apatsev-nexus-playbook'
    httpd_setup_enable: false
    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: 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

    # Yum. Change nexus_config_yum to true for create yum repository
    nexus_config_yum: true
    nexus_repos_yum_hosted:
      - name: private_yum_centos_7
        repodata_depth: 1
    nexus_repos_yum_proxy:
      - name: epel_centos_7_x86_64
        remote_url: http://download.fedoraproject.org/pub/epel/7/x86_64
        maximum_component_age: -1
        maximum_metadata_age: -1
        negative_cache_ttl: 60
      - name: centos-7-os-x86_64
        remote_url: http://mirror.centos.org/centos/7/os/x86_64/
        maximum_component_age: -1
        maximum_metadata_age: -1
        negative_cache_ttl: 60
    nexus_repos_yum_group:
      - name: yum_all
        member_repos:
          - private_yum_centos_7
          - epel_centos_7_x86_64

    # NPM. Change nexus_config_npm to true for create npm repository
    nexus_config_npm: true
    nexus_repos_npm_hosted: []
    nexus_repos_npm_group:
      - name: npm-public
        member_repos:
          - npm-registry
    nexus_repos_npm_proxy:
      - name: npm-registry
        remote_url: https://registry.npmjs.org/
        negative_cache_enabled: false

    # Docker. Change nexus_config_docker to true for create docker repository
    nexus_config_docker: true
    nexus_repos_docker_hosted:
      - name: docker-hosted
        http_port: "{{ nexus_docker_hosted_port }}"
        v1_enabled: True
    nexus_repos_docker_proxy:
      - name: docker-proxy
        http_port: "{{ nexus_docker_proxy_port }}"
        v1_enabled: True
        index_type: "HUB"
        remote_url: "https://registry-1.docker.io"
        use_nexus_certificates_to_access_index: false
        maximum_component_age: 1440
        maximum_metadata_age: 1440
        negative_cache_enabled: true
        negative_cache_ttl: 1440
    nexus_repos_docker_group:
      - name: docker-group
        http_port: "{{ nexus_docker_group_port }}"
        v1_enabled: True
        member_repos:
          - docker-hosted
          - docker-proxy

    # Bower. Change nexus_config_bower to true for create bower repository
    nexus_config_bower: true
    nexus_repos_bower_hosted:
      - name: bower-hosted
    nexus_repos_bower_proxy:
      - name: bower-proxy
        index_type: "proxy"
        remote_url: "https://registry.bower.io"
        use_nexus_certificates_to_access_index: false
        maximum_component_age: 1440
        maximum_metadata_age: 1440
        negative_cache_enabled: true
        negative_cache_ttl: 1440
    nexus_repos_bower_group:
      - name: bower-group
        member_repos:
          - bower-hosted
          - bower-proxy

    # Pypi. Change nexus_config_pypi to true for create pypi repository
    nexus_config_pypi: true
    nexus_repos_pypi_hosted:
      - name: pypi-hosted
    nexus_repos_pypi_proxy:
      - name: pypi-proxy
        index_type: "proxy"
        remote_url: "https://pypi.org/"
        use_nexus_certificates_to_access_index: false
        maximum_component_age: 1440
        maximum_metadata_age: 1440
        negative_cache_enabled: true
        negative_cache_ttl: 1440
    nexus_repos_pypi_group:
      - name: pypi-group
        member_repos:
          - pypi-hosted
          - pypi-proxy

    # rubygems. Change nexus_config_rubygems to true for create rubygems repository
    nexus_config_rubygems: true
    nexus_repos_rubygems_hosted:
      - name: rubygems-hosted
    nexus_repos_rubygems_proxy:
      - name: rubygems-proxy
        index_type: "proxy"
        remote_url: "https://rubygems.org"
        use_nexus_certificates_to_access_index: false
        maximum_component_age: 1440
        maximum_metadata_age: 1440
        negative_cache_enabled: true
        negative_cache_ttl: 1440
    nexus_repos_rubygems_group:
      - name: rubygems-group
        member_repos:
          - rubygems-hosted
          - rubygems-proxy

    # gitlfs. Change nexus_config_gitlfs to true for create gitlfs repository
    nexus_config_gitlfs: true
    nexus_repos_gitlfs_hosted:
      - name: gitlfs-hosted

  roles:
    - { role: geerlingguy.java }
    # Debian/Ubuntu only
    # - { role: geerlingguy.apache, apache_create_vhosts: no, apache_mods_enabled: ["proxy_http.load", "headers.load"], apache_remove_default_vhost: true, tags: ["geerlingguy.apache"] }
    # RedHat/CentOS only
    - { role: geerlingguy.apache, apache_create_vhosts: no, apache_remove_default_vhost: true, tags: ["geerlingguy.apache"] }
    - { role: ansible-thoteam.nexus3-oss, tags: ['ansible-thoteam.nexus3-oss'] }

ஸ்கிரீன் ஷாட்கள்:

குறியீட்டு அணுகுமுறையாக உள்கட்டமைப்பைப் பயன்படுத்தி Nexus Sonatype ஐ நிறுவுதல் மற்றும் கட்டமைத்தல்

குறியீட்டு அணுகுமுறையாக உள்கட்டமைப்பைப் பயன்படுத்தி Nexus Sonatype ஐ நிறுவுதல் மற்றும் கட்டமைத்தல்

மாறக்கூடிய பாத்திரங்கள்

பங்கு மாறிகள்

இயல்புநிலை மதிப்புகள் கொண்ட மாறிகள் (பார்க்க default/main.yml):

பொது மாறிகள்

    nexus_version: ''
    nexus_timezone: 'UTC'

இயல்பாக, பங்கு Nexus இன் சமீபத்திய கிடைக்கக்கூடிய பதிப்பை நிறுவும். மாறியை மாற்றுவதன் மூலம் பதிப்பை சரிசெய்யலாம் nexus_version. கிடைக்கக்கூடிய பதிப்புகளைப் பார்க்கவும் https://www.sonatype.com/download-oss-sonatype.

நீங்கள் புதிய பதிப்பிற்கு மாறினால், உங்கள் Nexus நிறுவலைப் புதுப்பிக்க பங்கு முயற்சிக்கும்.

சமீபத்திய பதிப்பை விட Nexus இன் பழைய பதிப்பை நீங்கள் பயன்படுத்துகிறீர்கள் எனில், நிறுவப்பட்ட வெளியீட்டில் இல்லாத அம்சங்களை நீங்கள் பயன்படுத்தவில்லை என்பதை உறுதிப்படுத்திக் கொள்ள வேண்டும் (உதாரணமாக, 3.8.0, git lfs repo ஐ விட அதிகமான nexusக்கு yum களஞ்சியங்களை ஹோஸ்டிங் செய்யலாம். 3.3.0 போன்றவற்றை விட அதிகமான நெக்ஸஸுக்கு)

nexus timezone ஜாவா நேர மண்டலத்தின் பெயர், இது nexus_scheduled பணிகளுக்கு பின்வரும் கிரான் வெளிப்பாடுகளுடன் இணைந்து பயனுள்ளதாக இருக்கும்.

நெக்ஸஸ் போர்ட் மற்றும் சூழல் பாதை

    nexus_default_port: 8081
    nexus_default_context_path: '/'

ஜாவா இணைப்பு செயல்முறையின் போர்ட் மற்றும் சூழல் பாதை. nexus_default_context_path அமைக்கப்படும் போது முன்னோக்கி சாய்வு இருக்க வேண்டும், எ.கா: nexus_default_context_path: '/nexus/'.

Nexus OS பயனர் மற்றும் குழு

    nexus_os_group: 'nexus'
    nexus_os_user: 'nexus'

Nexus கோப்புகளை சொந்தமாக வைத்திருக்கவும், சேவையை இயக்கவும் பயன்படுத்தப்படும் பயனர் மற்றும் குழு ஒன்று விடுபட்டால், அந்த பாத்திரத்தால் உருவாக்கப்படும்.

    nexus_os_user_home_dir: '/home/nexus'

நெக்ஸஸ் பயனருக்கான இயல்புநிலை முகப்பு கோப்பகத்தை மாற்ற அனுமதிக்கவும்

Nexus நிகழ்வு கோப்பகங்கள்

    nexus_installation_dir: '/opt'
    nexus_data_dir: '/var/nexus'
    nexus_tmp_dir: "{{ (ansible_os_family == 'RedHat') | ternary('/var/nexus-tmp', '/tmp/nexus') }}"

நெக்ஸஸ் பட்டியல்கள்.

  • nexus_installation_dir நிறுவப்பட்ட இயங்கக்கூடிய கோப்புகளைக் கொண்டுள்ளது
  • nexus_data_dir அனைத்து கட்டமைப்பு, களஞ்சியங்கள் மற்றும் பதிவிறக்கம் செய்யப்பட்ட கலைப்பொருட்கள் ஆகியவற்றைக் கொண்டுள்ளது. தனிப்பயன் பிளாப்ஸ்டோர் பாதைகள் nexus_data_dir தனிப்பயனாக்கலாம், கீழே பார்க்கவும் nexus_blobstores.
  • nexus_tmp_dir அனைத்து தற்காலிக கோப்புகளையும் கொண்டுள்ளது. redhatக்கான இயல்புநிலை பாதை இதிலிருந்து நகர்த்தப்பட்டது /tmp தானியங்கி துப்புரவு நடைமுறைகளுடன் சாத்தியமான சிக்கல்களை சமாளிக்க. பார்க்கவும் #168.

Nexus JVM நினைவகப் பயன்பாட்டை உள்ளமைக்கிறது

    nexus_min_heap_size: "1200M"
    nexus_max_heap_size: "{{ nexus_min_heap_size }}"
    nexus_max_direct_memory: "2G"

இவை Nexusக்கான இயல்புநிலை அமைப்புகள். தயவுசெய்து இந்த மதிப்புகளை மாற்ற வேண்டாம் நீங்கள் படிக்கவில்லை என்றால் நெக்ஸஸ் சிஸ்டம் தேவைகள் நினைவக பிரிவு அவர்கள் என்ன செய்கிறார்கள் என்று புரியவில்லை.

இரண்டாவது எச்சரிக்கையாக, மேலே உள்ள ஆவணத்திலிருந்து ஒரு பகுதி இங்கே:

செயல்திறனை மேம்படுத்தும் முயற்சியில் பரிந்துரைக்கப்பட்ட மதிப்புகளுக்கு அப்பால் JVM ஹீப் நினைவகத்தை அதிகரிக்க பரிந்துரைக்கப்படவில்லை. இது உண்மையில் எதிர் விளைவைக் கொண்டிருக்கலாம், இதன் விளைவாக இயக்க முறைமைக்கு தேவையற்ற வேலை ஏற்படும்.

நிர்வாகி கடவுச்சொல்

    nexus_admin_password: 'changeme'

அமைப்பிற்கான "நிர்வாகம்" கணக்கு கடவுச்சொல். இது முதல் இயல்புநிலை நிறுவலில் மட்டுமே வேலை செய்கிறது. ஒரு பாத்திரத்தைப் பயன்படுத்தி பின்னர் அதை மாற்ற விரும்பினால், [முதல் நிறுவலுக்குப் பிறகு நிர்வாகி கடவுச்சொல்லை மாற்றவும்](# change-admin-password-after-first-install) பார்க்கவும்.

உங்கள் கடவுச்சொல்லை பிளேபுக்கில் தெளிவான உரையாக சேமிக்காமல், [ansible-vault encryption] பயன்படுத்துமாறு கடுமையாக பரிந்துரைக்கப்படுகிறது.https://docs.ansible.com/ansible/latest/user_guide/vault.html) (இன்லைனில் அல்லது தனி கோப்பில் எ.கா. include_vars)

முன்னிருப்பாக அநாமதேய அணுகல்

    nexus_anonymous_access: false

அநாமதேய அணுகல் இயல்பாகவே முடக்கப்பட்டுள்ளது. பற்றி மேலும் வாசிக்க அநாமதேய அணுகல்.

பொது ஹோஸ்ட்பெயர்

    nexus_public_hostname: 'nexus.vm'
    nexus_public_scheme: https

முழுத் தகுதியான டொமைன் பெயர் மற்றும் திட்டம் (https அல்லது http) அதன் கீழ் Nexus நிகழ்வு அதன் வாடிக்கையாளர்களுக்குக் கிடைக்கும்.

இந்தப் பாத்திரத்திற்கான API அணுகல்

    nexus_api_hostname: localhost
    nexus_api_scheme: http
    nexus_api_validate_certs: "{{ nexus_api_scheme == 'https' }}"
    nexus_api_context_path: "{{ nexus_default_context_path }}"
    nexus_api_port: "{{ nexus_default_port }}"

இந்த மாறிகள், பங்கை வழங்குவதற்காக Nexus API உடன் எவ்வாறு இணைகிறது என்பதைக் கட்டுப்படுத்துகிறது.
மேம்பட்ட பயனர்களுக்கு மட்டுமே. இந்த இயல்புநிலை அமைப்புகளை நீங்கள் ஒருவேளை மாற்ற விரும்பவில்லை

தலைகீழ் ப்ராக்ஸியை அமைத்தல்

    httpd_setup_enable: false
    httpd_server_name: "{{ nexus_public_hostname }}"
    httpd_default_admin_email: "[email protected]"
    httpd_ssl_certificate_file: 'files/nexus.vm.crt'
    httpd_ssl_certificate_key_file: 'files/nexus.vm.key'
    # httpd_ssl_certificate_chain_file: "{{ httpd_ssl_certificate_file }}"
    httpd_copy_ssl_files: true

நிறுவ SSL ரிவர்ஸ் ப்ராக்ஸி.
இதைச் செய்ய, நீங்கள் httpd ஐ நிறுவ வேண்டும். குறிப்பு: எப்போது httpd_setup_enable மதிப்பு அமைக்கtrue, நெக்ஸஸ் தொடர்புகள் 127.0.0.1:8081, இவ்வாறு இல்லை வெளிப்புற IP முகவரியிலிருந்து HTTP போர்ட் 8081 வழியாக நேரடியாக அணுக முடியும்.

பயன்படுத்தப்படும் இயல்புநிலை ஹோஸ்ட்பெயர் nexus_public_hostname. சில காரணங்களுக்காக உங்களுக்கு வெவ்வேறு பெயர்கள் தேவைப்பட்டால், நீங்கள் அமைக்கலாம் httpd_server_name வேறு அர்த்தத்துடன்.

С httpd_copy_ssl_files: true (இயல்புநிலையாக) மேலே உள்ள சான்றிதழ்கள் உங்கள் பிளேபுக் கோப்பகத்தில் இருக்க வேண்டும், மேலும் அவை சர்வரில் நகலெடுக்கப்பட்டு அப்பாச்சியில் கட்டமைக்கப்படும்.

சர்வரில் இருக்கும் சான்றிதழ்களைப் பயன்படுத்த விரும்பினால், நிறுவவும் httpd_copy_ssl_files: false மற்றும் பின்வரும் மாறிகளை வழங்கவும்:

    # These specifies to the vhost where to find on the remote server file
    # system the certificate files.
    httpd_ssl_cert_file_location: "/etc/pki/tls/certs/wildcard.vm.crt"
    httpd_ssl_cert_key_location: "/etc/pki/tls/private/wildcard.vm.key"
    # httpd_ssl_cert_chain_file_location: "{{ httpd_ssl_cert_file_location }}"

httpd_ssl_cert_chain_file_location இது விருப்பமானது மற்றும் நீங்கள் சங்கிலி கோப்பைத் தனிப்பயனாக்க விரும்பவில்லை என்றால் அமைக்கப்படாமல் விடப்பட வேண்டும்

    httpd_default_admin_email: "[email protected]"

இயல்புநிலை நிர்வாக மின்னஞ்சல் முகவரியை அமைக்கவும்

LDAP கட்டமைப்பு

LDAP இணைப்புகள் மற்றும் பாதுகாப்பு மண்டலம் இயல்பாகவே முடக்கப்பட்டுள்ளன

    nexus_ldap_realm: false
    ldap_connections: []

LDAP இணைப்புகள், ஒவ்வொரு உறுப்பும் இப்படி இருக்கும்:

    nexus_ldap_realm: true
    ldap_connections:
      - 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_use_trust_store: false # Wether or not to use certs in the nexus trust store
        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

அநாமதேய அங்கீகாரத்திற்கான எடுத்துக்காட்டு LDAP உள்ளமைவு (அநாமதேய பிணைப்பு), இதுவும் "குறைந்தபட்ச" உள்ளமைவாகும்:

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

எளிய அங்கீகாரத்திற்கான எடுத்துக்காட்டு LDAP உள்ளமைவு (DSA கணக்கைப் பயன்படுத்தி):

    nexus_ldap_realm: true
    ldap_connections:
      - ldap_name: 'LDAP config with DSA'
        ldap_protocol: 'ldaps'
        ldap_hostname: 'annuaire.mycompany.com'
        ldap_port: 636
        ldap_use_trust_store: false
        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

எளிய அங்கீகாரத்திற்கான எடுத்துக்காட்டு LDAP உள்ளமைவு (DSA கணக்கைப் பயன்படுத்துதல்) + பாத்திரங்களாகப் பொருத்தப்பட்ட குழுக்கள்:

    nexus_ldap_realm: true
    ldap_connections
      - ldap_name: 'LDAP config with DSA'
        ldap_protocol: 'ldaps'
        ldap_hostname: 'annuaire.mycompany.com'
        ldap_port: 636
        ldap_use_trust_store: false
        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

எளிய அங்கீகாரத்திற்கான எடுத்துக்காட்டு LDAP உள்ளமைவு (DSA கணக்கைப் பயன்படுத்தி) + குழுக்கள் மாறும் வகையில் பாத்திரங்களாகப் பொருத்தப்பட்டுள்ளன:

    nexus_ldap_realm: true
    ldap_connections:
      - ldap_name: 'LDAP config with DSA'
        ldap_protocol: 'ldaps'
        ldap_hostname: 'annuaire.mycompany.com'
        ldap_port: 636
        ldap_use_trust_store: false
        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_map_groups_as_roles_type: 'dynamic'
        ldap_user_memberof_attribute: 'memberOf'

சலுகைகள்

    nexus_privileges:
      - name: all-repos-read # used as key to update a privilege
        # type: <one of application, repository-admin, repository-content-selector, repository-view, script or wildcard>
        description: 'Read & Browse access to all repos'
        repository: '*'
        actions: # can be add, browse, create, delete, edit, read or  * (all)
          - read
          - browse
        # pattern: pattern
        # domain: domain
        # script_name: name

பட்டியல் சலுகைகள் அமைப்புகளுக்கு. சிறப்புரிமை வகையைப் பொறுத்து எந்த மாறிகள் அமைக்கப்பட வேண்டும் என்பதைச் சரிபார்க்க ஆவணங்கள் மற்றும் GUI ஐப் பார்க்கவும்.

இந்த கூறுகள் பின்வரும் இயல்புநிலை மதிப்புகளுடன் இணைக்கப்பட்டுள்ளன:

    _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

பட்டியல் பாத்திரங்கள் அமைப்புகளுக்கு.

பயனர்கள்

    nexus_local_users: []
      # - username: jenkins # used as key to update
      #   state: present # default value if ommited, use 'absent' to remove user
      #   first_name: Jenkins
      #   last_name: CI
      #   email: [email protected]
      #   password: "s3cr3t"
      #   roles:
      #     - developers # role ID

நெக்ஸஸில் உருவாக்க உள்ளூர் (LDAP அல்லாத) பயனர்கள்/கணக்குகள் பட்டியல்.

Nexus இல் உருவாக்க உள்ளூர் (LDAP அல்லாத) பயனர்கள்/கணக்குகளின் பட்டியல்.

      nexus_ldap_users: []
      # - username: j.doe
      #   state: present
      #   roles:
      #     - "nx-admin"

பயனர்கள்/பாத்திரங்களின் Ldap மேப்பிங். நிலை absent ஏற்கனவே இருக்கும் பயனரிடமிருந்து பாத்திரங்களை அகற்றும்.
Ldap பயனர்கள் நீக்கப்படவில்லை. இல்லாத பயனருக்கு ஒரு பங்கை அமைக்க முயற்சித்தால் பிழை ஏற்படும்.

உள்ளடக்க தேர்வாளர்கள்

  nexus_content_selectors:
  - name: docker-login
    description: Selector for docker login privilege
    search_expression: format=="docker" and path=~"/v2/"

உள்ளடக்கத் தேர்வியைப் பற்றிய கூடுதல் தகவலுக்கு, பார்க்கவும் ஆவணப்படுத்தல்.

உள்ளடக்கத் தேர்வியைப் பயன்படுத்த, புதிய சிறப்புரிமையைச் சேர்க்கவும் type: repository-content-selector மற்றும் தொடர்புடையதுcontentSelector

- name: docker-login-privilege
  type: repository-content-selector
  contentSelector: docker-login
  description: 'Login to Docker registry'
  repository: '*'
  actions:
  - read
  - browse

பிளாப்ஸ்டோர்கள் மற்றும் களஞ்சியங்கள்

    nexus_delete_default_repos: false

நெக்ஸஸ் நிறுவல் ஆரம்ப இயல்புநிலை உள்ளமைவிலிருந்து களஞ்சியங்களை நீக்கவும். இந்த படியானது முதல் முறை நிறுவலின் போது மட்டுமே செயல்படுத்தப்படும் (எப்போது nexus_data_dir காலியாக இருப்பது கண்டறியப்பட்டது).

Nexus க்கான இயல்புநிலை இயல்புநிலை உள்ளமைவிலிருந்து களஞ்சியங்களை நீக்குகிறது. இந்த நடவடிக்கை முதல் நிறுவலின் போது மட்டுமே செய்யப்படுகிறது (எப்போது nexus_data_dir காலியாக).

    nexus_delete_default_blobstore: false

நெக்ஸஸ் நிறுவல் ஆரம்ப இயல்புநிலை உள்ளமைவிலிருந்து இயல்புநிலை ப்ளாப்ஸ்டோரை நீக்கவும். இருந்தால் மட்டுமே இதைச் செய்ய முடியும் nexus_delete_default_repos: true மற்றும் அனைத்து உள்ளமைக்கப்பட்ட களஞ்சியங்களும் (கீழே காண்க) வெளிப்படையானவை blob_store: custom. இந்த படியானது முதல் முறை நிறுவலின் போது மட்டுமே செயல்படுத்தப்படும் (எப்போது nexus_data_dir காலியாக இருப்பது கண்டறியப்பட்டது).

ப்ளாப் சேமிப்பகத்தை (பைனரி கலைப்பொருட்கள்) அகற்றுவது ஆரம்ப கட்டமைப்பிலிருந்து இயல்பாகவே முடக்கப்பட்டுள்ளது. குமிழ் சேமிப்பகத்தை (பைனரி கலைப்பொருட்கள்) அகற்ற, அணைக்கவும் nexus_delete_default_repos: true. இந்த நடவடிக்கை முதல் நிறுவலின் போது மட்டுமே செய்யப்படுகிறது (எப்போது nexus_data_dir காலியாக).

    nexus_blobstores: []
    # example blobstore item :
    # - name: separate-storage
    #   type: file
    #   path: /mnt/custom/path
    # - name: s3-blobstore
    #   type: S3
    #   config:
    #     bucket: s3-blobstore
    #     accessKeyId: "{{ VAULT_ENCRYPTED_KEY_ID }}"
    #     secretAccessKey: "{{ VAULT_ENCRYPTED_ACCESS_KEY }}"

ப்ளாப்ஸ்டோர்ஸ் உருவாக்க. ஆரம்ப உருவாக்கத்திற்குப் பிறகு ஒரு ப்ளாப்ஸ்டோர் பாதை மற்றும் ஒரு களஞ்சிய ப்ளாப்ஸ்டோரைப் புதுப்பிக்க முடியாது (இங்குள்ள எந்த புதுப்பிப்பும் மறு-ஒதுக்கீட்டில் புறக்கணிக்கப்படும்).

S3 இல் ப்ளாப்ஸ்டோரை உள்ளமைப்பது ஒரு வசதிக்காக வழங்கப்படுகிறது மற்றும் டிராவிஸில் நாங்கள் இயக்கும் தானியங்கு சோதனைகளின் ஒரு பகுதியாக இல்லை. AWS இல் பயன்படுத்தப்படும் நிகழ்வுகளுக்கு மட்டுமே S3 இல் சேமிப்பது பரிந்துரைக்கப்படுகிறது என்பதை நினைவில் கொள்ளவும்.

உருவாக்கம் ப்ளாப்ஸ்டோர்ஸ். ஆரம்ப உருவாக்கத்திற்குப் பிறகு சேமிப்பக பாதை மற்றும் சேமிப்பக களஞ்சியத்தை புதுப்பிக்க முடியாது (இங்குள்ள எந்த புதுப்பிப்பும் மீண்டும் நிறுவப்படும்போது புறக்கணிக்கப்படும்).

S3 இல் ப்ளாப் சேமிப்பகத்தை அமைப்பது ஒரு வசதியாக வழங்கப்படுகிறது. AWS இல் பயன்படுத்தப்படும் நிகழ்வுகளுக்கு மட்டுமே S3 சேமிப்பிடம் பரிந்துரைக்கப்படுகிறது என்பதை நினைவில் கொள்ளவும்.

    nexus_repos_maven_proxy:
      - name: central
        remote_url: 'https://repo1.maven.org/maven2/'
        layout_policy: permissive
        # maximum_component_age: -1
        # maximum_metadata_age: 1440
        # negative_cache_enabled: true
        # negative_cache_ttl: 1440
      - name: jboss
        remote_url: 'https://repository.jboss.org/nexus/content/groups/public-jboss/'
        # maximum_component_age: -1
        # maximum_metadata_age: 1440
        # negative_cache_enabled: true
        # negative_cache_ttl: 1440
    # 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'
    #   # maximum_component_age: -1
    #   # maximum_metadata_age: 1440
    #   # negative_cache_enabled: true
    #   # negative_cache_ttl: 1440

மேலே உள்ளமைவு ஒரு எடுத்துக்காட்டு ப்ராக்ஸி சர்வர் மேவன்.

    nexus_repos_maven_hosted:
      - name: private-release
        version_policy: release
        write_policy: allow_once  # one of "allow", "allow_once" or "deny"

மேவன் ஹோஸ்ட் செய்யப்பட்ட களஞ்சியங்கள் கட்டமைப்பு. எதிர்மறை கேச் கட்டமைப்பு விருப்பமானது மற்றும் தவிர்க்கப்பட்டால் மேலே உள்ள மதிப்புகளுக்கு இயல்புநிலையாக இருக்கும்.

கட்டமைப்பு ஹோஸ்ட் செய்யப்பட்ட களஞ்சியங்கள் மேவன். எதிர்மறை கேச் உள்ளமைவு (-1) விருப்பமானது மற்றும் குறிப்பிடப்படாவிட்டால் மேலே உள்ள மதிப்புகளுக்கு இயல்புநிலையாக இருக்கும்.

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

கட்டமைப்பு குழுக்கள் மேவன்.

மூன்று களஞ்சிய வகைகளும் பின்வரும் இயல்புநிலை மதிப்புகளுடன் இணைக்கப்பட்டுள்ளன:

    _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 # one of "allow", "allow_once" or "deny"
      maximum_component_age: -1  # Nexus gui default. For proxies only
      maximum_metadata_age: 1440  # Nexus gui default. For proxies only
      negative_cache_enabled: true # Nexus gui default. For proxies only
      negative_cache_ttl: 1440 # Nexus gui default. For proxies only

Docker, Pypi, Raw, Rubygems, Bower, NPM, Git-LFS மற்றும் yum களஞ்சிய வகைகள்:
பார்க்க defaults/main.yml இந்த விருப்பங்களுக்கு:

Docker, Pypi, Raw, Rubygems, Bower, NPM, Git-LFS மற்றும் yum களஞ்சியங்கள் இயல்பாகவே முடக்கப்பட்டுள்ளன:
பார்க்க defaults/main.yml இந்த விருப்பங்களுக்கு:

      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
      nexus_config_yum: false

மேவனைத் தவிர வேறு வகையான களஞ்சியங்களைப் பயன்படுத்த விரும்பினால், சில பாதுகாப்பு நோக்கங்களை நீங்கள் இயக்க வேண்டியிருக்கும் என்பதை நினைவில் கொள்ளவும். இது இயல்பாகவே தவறானது

nexus_nuget_api_key_realm: false
nexus_npm_bearer_token_realm: false
nexus_docker_bearer_token_realm: false  # required for docker anonymous access

Remote User Realmஐயும் பயன்படுத்தி இயக்கலாம்

nexus_rut_auth_realm: true

மற்றும் தலைப்பை வரையறுப்பதன் மூலம் தனிப்பயனாக்கலாம்

nexus_rut_auth_header: "CUSTOM_HEADER"

திட்டமிடப்பட்ட பணிகள்

    nexus_scheduled_tasks: []
    #  #  Example task to compact blobstore :
    #  - name: compact-docker-blobstore
    #    cron: '0 0 22 * * ?'
    #    typeId: blobstore.compact
    #    task_alert_email: [email protected]  # optional
    #    taskProperties:
    #      blobstoreName: {{ nexus_blob_names.docker.blob }} # all task attributes are stored as strings by nexus internally
    #  #  Example task to purge maven snapshots
    #  - name: Purge-maven-snapshots
    #    cron: '0 50 23 * * ?'
    #    typeId: repository.maven.remove-snapshots
    #    task_alert_email: [email protected]  # optional
    #    taskProperties:
    #      repositoryName: "*"  # * for all repos. Change to a repository name if you only want a specific one
    #      minimumRetained: "2"
    #      snapshotRetentionDays: "2"
    #      gracePeriodInDays: "2"
    #    booleanTaskProperties:
    #      removeIfReleased: true
    #  #  Example task to purge unused docker manifest and images
    #  - name: Purge unused docker manifests and images
    #    cron: '0 55 23 * * ?'
    #    typeId: "repository.docker.gc"
    #    task_alert_email: [email protected]  # optional
    #    taskProperties:
    #      repositoryName: "*"  # * for all repos. Change to a repository name if you only want a specific one
    #  #  Example task to purge incomplete docker uploads
    #  - name: Purge incomplete docker uploads
    #    cron: '0 0 0 * * ?'
    #    typeId: "repository.docker.upload-purge"
    #    task_alert_email: [email protected]  # optional
    #    taskProperties:
    #      age: "24"

திட்டமிடப்பட்ட பணிகள் அமைப்புகளுக்கு. typeId மற்றும் குறிப்பிட்ட பணிtaskProperties/booleanTaskProperties நீங்கள் யூகிக்க முடியும்:

  • ஜாவா வகை படிநிலையிலிருந்து org.sonatype.nexus.scheduling.TaskDescriptorSupport
  • உங்கள் உலாவியில் HTML பணி உருவாக்கும் படிவத்தை சரிபார்க்கிறது
  • ஒரு பணியை கைமுறையாக அமைக்கும்போது அஜாக்ஸ் கோரிக்கைகளை உலாவியில் பார்ப்பதிலிருந்து.

பணி பண்புகள் அவற்றின் வகையைப் பொறுத்து சரியான yaml தொகுதியில் அறிவிக்கப்பட வேண்டும்:

  • taskProperties அனைத்து சரம் பண்புகளுக்கும் (அதாவது களஞ்சியப் பெயர்கள், களஞ்சியப் பெயர்கள், கால அளவுகள்...).
  • booleanTaskProperties அனைத்து தருக்க பண்புகளுக்கும் (அதாவது நெக்ஸஸ் உருவாக்கும் பணியின் GUI இல் உள்ள தேர்வுப்பெட்டிகள்).

காப்புப்பிரதிகள்

      nexus_backup_configure: false
      nexus_backup_cron: '0 0 21 * * ?'  # See cron expressions definition in nexus create task gui
      nexus_backup_dir: '/var/nexus-backup'
      nexus_restore_log: '{{ nexus_backup_dir }}/nexus-restore.log'
      nexus_backup_rotate: false
      nexus_backup_rotate_first: false
      nexus_backup_keep_rotations: 4  # Keep 4 backup rotation by default (current + last 3)

நீங்கள் மாற்றும் வரை காப்புப்பிரதி கட்டமைக்கப்படாது nexus_backup_configure в true.
இந்த நிலையில், திட்டமிடப்பட்ட ஸ்கிரிப்ட் பணி Nexus இல் இயங்கும் வகையில் கட்டமைக்கப்படும்
குறிப்பிட்ட இடைவெளியில் nexus_backup_cron (இயல்புநிலை ஒவ்வொரு நாளும் 21:00).
விவரங்களுக்கு [இந்த பணிக்கான க்ரூவி டெம்ப்ளேட்டை](வார்ப்புருக்கள்/backup.grovy.j2) பார்க்கவும்.
இந்த திட்டமிடப்பட்ட பணி மற்றவர்களிடமிருந்து சுயாதீனமானது nexus_scheduled_tasksநீங்கள்
உங்கள் பிளேபுக்கில் அறிவிக்கவும்.

காப்புப்பிரதிகளை சுழற்ற/நீக்க விரும்பினால், நிறுவவும் nexus_backup_rotate: true நீங்கள் சேமிக்க விரும்பும் காப்புப்பிரதிகளின் எண்ணிக்கையை உள்ளமைக்கவும் nexus_backup_keep_rotations (இயல்புநிலை 4).

சுழற்சியைப் பயன்படுத்தும் போது, ​​காப்புப் பிரதி செயல்பாட்டின் போது கூடுதல் வட்டு இடத்தை சேமிக்க விரும்பினால்,
நீங்கள் நிறுவலாம் nexus_backup_rotate_first: true. இது காப்புப்பிரதிக்கு முன் முன்-சுழற்சி/நீக்கத்தை உள்ளமைக்கும். முன்னிருப்பாக, காப்புப்பிரதி உருவாக்கப்பட்ட பிறகு சுழற்சி ஏற்படுகிறது. இந்த வழக்கில் பழைய காப்புப்பிரதிகள் என்பதை நினைவில் கொள்க
தற்போதைய காப்புப்பிரதியை உருவாக்கும் முன் நீக்கப்படும்.

மீட்பு செயல்முறை

அளவுருவுடன் பிளேபுக்கை இயக்கவும் -e nexus_restore_point=<YYYY-MM-dd-HH-mm-ss>
(எடுத்துக்காட்டாக, 2017-12-17-21-00-00 டிசம்பர் 17, 2017 அன்று 21:00 மணிக்கு

நெக்ஸஸை நீக்குகிறது

எச்சரிக்கை: இது உங்கள் தற்போதைய தரவை முற்றிலும் நீக்கிவிடும். தேவைப்பட்டால், முன்கூட்டியே காப்புப்பிரதி எடுக்க மறக்காதீர்கள்

ஒரு மாறியைப் பயன்படுத்தவும் nexus_purgeநீங்கள் புதிதாக மறுதொடக்கம் செய்ய வேண்டும் மற்றும் அனைத்து தரவையும் அகற்றி, நெக்ஸஸ் நிகழ்வை மீண்டும் நிறுவ வேண்டும்.

ansible-playbook -i your/inventory.ini your_nexus_playbook.yml -e nexus_purge=true

முதல் நிறுவலுக்குப் பிறகு நிர்வாகி கடவுச்சொல்லை மாற்றவும்

    nexus_default_admin_password: 'admin123'

உங்கள் பிளேபுக்கில் இதை மாற்றக்கூடாது. இந்த மாறி முதலில் நிறுவப்பட்ட போது இயல்புநிலை Nexus நிர்வாகி கடவுச்சொல்லுடன் நிரப்பப்பட்டு, நிர்வாகி கடவுச்சொல்லை மாற்ற முடியும் என்பதை உறுதி செய்கிறது nexus_admin_password.

முதல் நிறுவலுக்குப் பிறகு நிர்வாகி கடவுச்சொல்லை மாற்ற விரும்பினால், கட்டளை வரியிலிருந்து பழைய கடவுச்சொல்லை தற்காலிகமாக மாற்றலாம். மாற்றத்திற்குப் பிறகு nexus_admin_password உங்கள் பிளேபுக்கில் நீங்கள் இயக்கலாம்:

ansible-playbook -i your/inventory.ini your_playbook.yml -e nexus_default_admin_password=oldPassword

Nexus Sonatype இல் டெலிகிராம் சேனல்: https://t.me/ru_nexus_sonatype

பதிவு செய்த பயனர்கள் மட்டுமே கணக்கெடுப்பில் பங்கேற்க முடியும். உள்நுழையவும், தயவு செய்து.

நீங்கள் என்ன கலைப்பொருள் களஞ்சியங்களைப் பயன்படுத்துகிறீர்கள்?

  • Sonatype Nexus இலவசம்

  • Sonatype Nexus செலுத்தப்பட்டது

  • செயற்கைத் தொழிற்சாலை இலவசம்

  • செயற்கைத் தொழிற்சாலை செலுத்தப்பட்டது

  • துறைமுகம்

  • பல்ப்

9 பயனர்கள் வாக்களித்தனர். 3 பயனர்கள் வாக்களிக்கவில்லை.

ஆதாரம்: www.habr.com

கருத்தைச் சேர்