cookbook 'nexus-grid', '~> 0.1.4'
nexus-grid (5) Versions 0.1.4 Follow0
Installs/Configures Sonatype Nexus Repository Manager
cookbook 'nexus-grid', '~> 0.1.4', :supermarket
knife supermarket install nexus-grid
knife supermarket download nexus-grid
nexus-grid Cookbook
This cookbook sets up a Sonatype Nexus Repository Manager by Docker Compose.
Contents
Requirements
platforms
- RHEL, CentOS >= 7.0
- Debian >= 8.0
- Ubuntu >= 14.04
packages
- none.
cookbooks
- docker-grid
- platform_utils
- ssl_cert
Attributes
| Key | Type | Description, example | Default | 
|---|---|---|---|
| ['nexus-grid']['with_ssl_cert_cookbook'] | Boolean | Activates TLS configurations by the ssl_certcookbook. Seeattributes/default.rb | false | 
| ['nexus-grid']['ssl_cert']['common_name'] | String | Server common name for TLS | node['fqdn'] | 
| ['nexus-grid']['docker-compose']['app_dir'] | String | "#{node['docker-grid']['compose']['app_dir']}/nexus" | |
| ['nexus-grid']['docker-compose']['etc_dir'] | String | "#{node['nexus-grid']['docker-compose']['app_dir']}/etc" | |
| ['nexus-grid']['docker-compose']['data_dir'] | String | Path string or nil (unset). | "#{node['nexus-grid']['docker-compose']['app_dir']}/data" | 
| ['nexus-grid']['docker-compose']['config'] | Hash | docker-compose.ymlconfigurations. | See attributes/default.rb | 
Usage
Recipes
nexus-grid::default
This recipe does nothing.
nexus-grid::docker-compose
This recipe generates a docker-compose.yml file for the Sonatype Nexus Repository Manager service.
Role Examples
- roles/nexus.rb
name 'nexus' description 'Nexus' run_list( 'role[docker]', 'recipe[nexus-grid::docker-compose]', ) image = 'sonatype/nexus3' #image = 'sonatype/nexus' # Nexus2 port = '8081' override_attributes( 'nexus-grid' => { 'docker-compose' => { 'config' => { 'version' => '2', 'services' => { 'reverseproxy' => { 'ports' => [ "#{port}:8081", ], 'volumes' => [ # This volume will be set by the nexus-grid::docker-compose recipe automatically. #"#{node['nexus-grid']['docker-compose']['etc_dir']}/nginx/nginx.conf:/etc/nginx/nginx.conf:ro", ], }, 'nexus' => { 'restart' => 'always', 'image' => image, 'volumes' => [ # This volume will be set by the nexus-grid::docker-compose recipe automatically. # * Nexus3 #"#{node['nexus-grid']['docker-compose']['data_dir']}:/nexus-data:rw", # * Nexus2 #"#{node['nexus-grid']['docker-compose']['data_dir']}:/sonatype-work:rw", ], 'environment' => { # * Nexus3 #'JAVA_MAX_HEAP' => '1200m', # passed as -Xmx. Defaults to 1200m. #'JAVA_MIN_HEAP' => '1200m', # passed as -Xms. Defaults to 1200m. #'EXTRA_JAVA_OPTS' => '', # Additional options can be passed to the JVM via this variable. # * Nexus2 #'CONTEXT_PATH' => '/nexus', #'MAX_HEAP' => '768m', #'MIN_HEAP' => '256m', #'JAVA_OPTS' => '-server -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true', #'LAUNCHER_CONF' => './conf/jetty.xml ./conf/jetty-requestlog.xml', }, }, }, }, }, }, )
- roles/nexus-with-ssl.rb
name 'nexus-with-ssl' description 'Nexus with SSL by reverse proxy (nginx)' run_list( #'recipe[ssl_cert::server_key_pairs]', # nexus-grid cookbook < 0.1.3 'role[docker]', 'recipe[nexus-grid::docker-compose]', ) image = 'sonatype/nexus3' #image = 'sonatype/nexus' # Nexus2 port = '8081' cn = 'nexus.io.example.com' override_attributes( 'ssl_cert' => { #'common_names' => [ # cn, # nexus-grid cookbook < 0.1.4 #], }, 'nexus-grid' => { 'with_ssl_cert_cookbook' => true, 'ssl_cert' => { 'common_name' => cn, }, 'docker-compose' => { 'config' => { 'version' => '2', 'services' => { 'reverseproxy' => { 'ports' => [ "#{port}:8081", ], 'volumes' => [ # These volumes will be set by the nexus-grid::docker-compose recipe automatically. #"#{node['nexus-grid']['docker-compose']['etc_dir']}/nginx/nginx.conf:/etc/nginx/nginx.conf:ro", # and server key pair volume conf. ], }, 'nexus' => { 'restart' => 'always', 'image' => image, 'volumes' => [ # This volume will be set by the nexus-grid::docker-compose recipe automatically. # * Nexus3 #"#{node['nexus-grid']['docker-compose']['data_dir']}:/nexus-data:rw", # * Nexus2 #"#{node['nexus-grid']['docker-compose']['data_dir']}:/sonatype-work:rw", ], 'environment' => { # * Nexus3 #'JAVA_MAX_HEAP' => '1200m', # passed as -Xmx. Defaults to 1200m. #'JAVA_MIN_HEAP' => '1200m', # passed as -Xms. Defaults to 1200m. #'EXTRA_JAVA_OPTS' => '', # Additional options can be passed to the JVM via this variable. # * Nexus2 #'CONTEXT_PATH' => '/nexus', #'MAX_HEAP' => '768m', #'MIN_HEAP' => '256m', #'JAVA_OPTS' => '-server -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true', #'LAUNCHER_CONF' => './conf/jetty.xml ./conf/jetty-requestlog.xml', }, }, }, }, }, }, )
SSL server keys and certificates management by the ssl_cert cookbook
- create vault items.
$ ruby -rjson -e 'puts JSON.generate({"private" => File.read("nexus.io.example.com.prod.key")})' \
> > ~/tmp/nexus.io.example.com.prod.key.json
$ ruby -rjson -e 'puts JSON.generate({"public" => File.read("nexus.io.example.com.prod.crt")})' \
> > ~/tmp/nexus.io.example.com.prod.crt.json
$ cd $CHEF_REPO_PATH
$ knife vault create ssl_server_keys nexus.io.example.com.prod \
> --json ~/tmp/nexus.io.example.com.prod.key.json
$ knife vault create ssl_server_certs nexus.io.example.com.prod \
> --json ~/tmp/nexus.io.example.com.prod.crt.json
- grant reference permission to the Concourse host
$ knife vault update ssl_server_keys nexus.io.example.com.prod -S 'name:nexus-host.example.com' $ knife vault update ssl_server_certs nexus.io.example.com.prod -S 'name:nexus-host.example.com'
- modify run_list and attributes
run_list( #'recipe[ssl_cert::server_key_pairs]', # nexus-grid cookbook < 0.1.3 'recipe[nexus-grid::docker-compose]', ) override_attributes( 'ssl_cert' => { #'common_names' => [ # 'nexus.io.example.com', # nexus-grid cookbook < 0.1.4 #], }, 'nexus-grid' => { 'with_ssl_cert_cookbook' => true, 'ssl_cert' => { 'common_name' => 'nexus.io.example.com', }, # ... }, )
License and Authors
- Author:: whitestar at osdn.jp
Copyright 2017, whitestar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Dependent cookbooks
| docker-grid >= 0.2.7 | 
| platform_utils >= 0.4.3 | 
| ssl_cert >= 0.4.1 | 
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
nexus-grid CHANGELOG
0.1.4
- improves server key pair deployment.
0.1.3
- includes the ssl_cert::server_key_pairsrecipe automatically.
0.1.2
- adds the Nexus 2 support.
- adds Concourse pipeline configurations.
0.1.1
- adds a reverse proxy (nginx) service to the nexus-grid::docker-composerecipe.
- adds the SSL configuration feature by reverse proxy.
0.1.0
- Initial release of nexus-gird
Collaborator Number Metric
        
            0.1.4 failed this metric
            Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
        
      Contributing File Metric
        
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
        
      Foodcritic Metric
        
            0.1.4 passed this metric
        
      No Binaries Metric
        
            0.1.4 passed this metric
        
      Testing File Metric
        
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
        
      Version Tag Metric
        
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
        
  
0.1.4 failed this metric
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
        
            0.1.4 passed this metric
        
      No Binaries Metric
        
            0.1.4 passed this metric
        
      Testing File Metric
        
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
        
      Version Tag Metric
        
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
        
  
0.1.4 passed this metric
            0.1.4 passed this metric
        
      Testing File Metric
        
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
        
      Version Tag Metric
        
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
        
  
0.1.4 failed this metric
            0.1.4 failed this metric
            Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number