-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEXUS-27617: Added new 3x-docker.rb recipe, this is effectively the r…
…h-docker recipe, without java included (#60)
- Loading branch information
1 parent
debd18c
commit 70a6cb6
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# | ||
# Cookbook:: nexus_repository_manager | ||
# Recipe:: 3x-docker | ||
# | ||
# Copyright:: Copyright (c) 2017-present Sonatype, Inc. Apache License, Version 2.0. | ||
|
||
if node['platform'] == 'rhel' | ||
default['yum']['rhel-7-server-rpms']['enabled'] = true | ||
default['yum']['rhel-7-server-rpms']['managed'] = true | ||
default['yum']['rhel-7-server-optional-rpms']['enabled'] = true | ||
default['yum']['rhel-7-server-optional-rpms']['managed'] = true | ||
default['yum']['rhel-7-server-thirdparty-oracle-java-rpms']['enabled'] = true | ||
default['yum']['rhel-7-server-thirdparty-oracle-java-rpms']['managed'] = true | ||
end | ||
|
||
include_recipe 'nexus_repository_manager::users' | ||
include_recipe 'nexus_repository_manager::download' | ||
include_recipe 'nexus_repository_manager::configure' | ||
|
||
set_limit 'nexus' do | ||
type 'hard' | ||
item 'nofile' | ||
value 65536 | ||
use_system true | ||
end | ||
|
||
set_limit 'nexus' do | ||
type 'soft' | ||
item 'nofile' | ||
value 65536 | ||
use_system true | ||
end | ||
|
||
ruby_block "remove java memory settings from nexus.vmoptions" do | ||
block do | ||
file = Chef::Util::FileEdit.new(node['nexus_repository_manager']['nexus_home']['path'] + '/bin/nexus.vmoptions') | ||
file.search_file_delete_line(/^-Xms/) | ||
file.search_file_delete_line(/^-Xmx/) | ||
file.search_file_delete_line(/^-XX:MaxDirectMemorySize/) | ||
file.write_file | ||
end | ||
end | ||
|
||
group 'root' do | ||
action :modify | ||
members 'nexus' | ||
append true | ||
end | ||
|
||
directory '/licenses/' do | ||
owner 'root' | ||
group 'root' | ||
mode '755' | ||
action :create | ||
end | ||
|
||
[ 'help.1', 'uid_template.sh', 'uid_entrypoint.sh', 'licenses/LICENSE' ].each do | file | | ||
cookbook_file "/#{file}" do | ||
source "rh-docker/#{file}" | ||
owner 'root' | ||
group 'root' | ||
mode '755' | ||
end | ||
end | ||
|
||
bash 'uid_template.sh' do | ||
code <<-EOH | ||
/uid_template.sh | ||
EOH | ||
end | ||
|
||
file '/etc/passwd' do | ||
mode '664' | ||
end |