-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP * Do it CircleCI! * WIP [skip ci] * Moved circleci config to root. Not currently doing any other script includes etc. [skip ci] * awslogsd their python setup sucks! [skip ci] * awslogsd their python setup sucks! [skip ci] * 2.2.0 - Read Changelog * 2.2.0 - Read Changelog * 2.2.0 - Read Changelog * * Switched boolean inside aws to ec2 deployment. Fits the logic better. * Added OpenJDK Java Install Option for Linux * Cleaned up kitchen config a bit * Added kitchen test suite for installing Java * WIP [skip ci] * WIP [skip ci] * WIP [skip ci] * Workaround for Ohai Virtualization Plugin failing to detect Docker correctly. * Made Rubocop happy * Versioned
- Loading branch information
1 parent
6d365be
commit 501da5a
Showing
25 changed files
with
366 additions
and
210 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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,24 @@ | ||
default['bonusbits_base']['java']['install'] = false | ||
default['bonusbits_base']['java']['remove_older'] = true | ||
|
||
# Java Package Name | ||
default['bonusbits_base']['java']['package'] = 'java-1.8.0-openjdk' # Example | ||
|
||
# Java Package Version (Lock Version Option) | ||
default['bonusbits_base']['java']['specify_version'] = false # Otherwise Latest will be installed | ||
default['bonusbits_base']['java']['version'] = '1.8.0.151-1.b12.35.amzn1' # Example | ||
# RHEL7 '1.8.0.141-1.b16.el7_3' | ||
|
||
# Debug | ||
message_list = [ | ||
'', | ||
'** Java **', | ||
"Install (#{node['bonusbits_base']['java']['install']})", | ||
"Remove Older (#{node['bonusbits_base']['java']['remove_older']})", | ||
"Package (#{node['bonusbits_base']['java']['package']})", | ||
"Version (#{node['bonusbits_base']['java']['version']})", | ||
"Specific Version (#{node['bonusbits_base']['java']['specify_version']})" | ||
] | ||
message_list.each do |message| | ||
Chef::Log.warn(message) | ||
end |
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
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
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 |
---|---|---|
@@ -1,34 +1,66 @@ | ||
# !! JUST EXAMPLE CODE - No Real info in Test Data Bag !! | ||
# TODO: Parameterize Values to make actually work based on overrides | ||
# TODO: Chain Support? | ||
|
||
# Staged Variables to Setup as Attributes TODO: Setup Loop for more than one cert? | ||
crt_filename = 'internal-ca.crt' | ||
cert_alias = 'internalca' | ||
|
||
# Fetch Data Bag | ||
data_bag = node['bonusbits_base']['certs']['data_bag'] | ||
data_bag_item = node['bonusbits_base']['certs']['data_bag_item'] | ||
node.run_state['certs_data_bag'] = data_bag_item(data_bag, data_bag_item) | ||
|
||
# OS | ||
template '/etc/pki/tls/certs/internal-ca.crt' do | ||
source 'certs/internal-ca.pem.erb' | ||
template "/etc/pki/tls/certs/#{crt_filename}" do | ||
source 'certs/cert.erb' | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
sensitive true | ||
variables( | ||
pem: node.run_state['certs_data_bag']['pem'] | ||
) | ||
end | ||
|
||
link "/etc/pki/tls/certs/#{node.run_state['certs_data_bag']['hash']}" do | ||
to '/etc/pki/tls/certs/cof-aws-ldap-ca.crt' | ||
to "/etc/pki/tls/certs/#{crt_filename}" | ||
owner 'root' | ||
group 'root' | ||
end | ||
|
||
# Chef | ||
template '/opt/chef/embedded/ssl/certs/internal-ca.crt' do | ||
source 'certs/internal-ca.pem.erb' | ||
template "/opt/chef/embedded/ssl/certs/#{crt_filename}" do | ||
source 'certs/cert.erb' | ||
owner 'root' | ||
group 'root' | ||
mode '0664' | ||
sensitive true | ||
variables( | ||
pem: node.run_state['certs_data_bag']['pem'] | ||
) | ||
end | ||
|
||
link "/opt/chef/embedded/ssl/certs/#{node.run_state['certs_data_bag']['hash']}" do | ||
to '/opt/chef/embedded/ssl/certs/internal-ca.crt' | ||
to "/opt/chef/embedded/ssl/certs/#{crt_filename}" | ||
owner 'root' | ||
group 'root' | ||
end | ||
|
||
# Java (Required: Java Installed Prior so keytool is installed...) | ||
ruby_block 'Install Internal CA Certificate to Java Keystore' do | ||
block do | ||
deployment_environment = node['bonusbits_base']['deployment_environment'] | ||
keystore_password = node.run_state['certs_data_bag']['keystore_password'][deployment_environment] | ||
# Check if already imported | ||
check_command = "keytool -list -keystore /etc/pki/ca-trust/extracted/java/cacerts -storepass #{keystore_password} -alias #{cert_alias}" | ||
cert_found = BonusBits::Shell.run_command(check_command, true) | ||
|
||
unless cert_found | ||
import_command = "keytool -importcert -file /etc/pki/tls/certs/#{crt_filename} -keystore /etc/pki/ca-trust/extracted/java/cacerts -storepass #{keystore_password} -alias #{cert_alias}" | ||
successful = BonusBits::Shell.run_command(import_command, true) | ||
raise 'ERROR: Importing Internal CA Certificate to Java Keystore!' unless successful | ||
end | ||
end | ||
only_if { node['bonusbits_base']['java']['configure'] } | ||
end |
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
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,23 @@ | ||
# Install Java OpenJDK from Package Repositories | ||
## (Before Uninstalling older so don't have to install deps) | ||
if node['bonusbits_base']['java']['specify_version'] | ||
package node['bonusbits_base']['java']['package'] do | ||
action :install | ||
version node['bonusbits_base']['java']['version'] | ||
end | ||
else | ||
package node['bonusbits_base']['java']['package'] | ||
end | ||
|
||
if node['bonusbits_base']['java']['remove_older'] | ||
# Remove Java 1.7.0 | ||
package 'java-1.7.0-openjdk' do | ||
action :remove | ||
ignore_failure | ||
end | ||
# Remove Java 1.6.0 | ||
package 'java-1.6.0-openjdk' do | ||
action :remove | ||
ignore_failure | ||
end | ||
end |
Oops, something went wrong.