Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Fix tests per rubocop and foodcritic #34

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AllCops:
DisplayCopNames: true
Exclude:
- vendor/**

Expand All @@ -14,3 +15,9 @@ MethodLength:
Enabled: false
NumericLiterals:
Enabled: false

Style/NumericLiteralPrefix:
EnforcedOctalStyle: zero_only

Metrics/BlockLength:
Enabled: false
19 changes: 15 additions & 4 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
# rubocop:disable Style/SingleSpaceBeforeFirstArg
name 'ice'
maintainer 'Medidata Solutions'
maintainer_email 'cookbooks@mdsol.com'
license 'Apache 2.0'
description 'Installs/Configures ice'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.2.14'
# rubocop:enable Style/SingleSpaceBeforeFirstArg

%w( ubuntu centos ).each do |os|
%w(
centos
ubuntu
).each do |os|
supports os
end

# Cookbook dependencies
%w( java apt nginx openssl logrotate chef-sugar ).each do |cb|
%w(
apt
chef-sugar
java
logrotate
nginx
openssl
).each do |cb|
depends cb
end

depends 'artifact', '>= 1.9.0'
depends 'tomcat', '>= 0.14.0'

source_url 'https://github.com/mdsol/ice_cookbook' if respond_to?(:source_url)
issues_url 'https://github.com/mdsol/ice_cookbook/issues' if respond_to?(:issues_url)
4 changes: 2 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
end

# Workaround for https://github.com/Netflix/ice/issues/100
%w( tagdb usage_daily usage_monthly usage_weekly cost_daily cost_monthly cost_weekly usage_hourly cost_hourly ).each do |dir|
%w(tagdb usage_daily usage_monthly usage_weekly cost_daily cost_monthly cost_weekly usage_hourly cost_hourly).each do |dir|
directory "#{node['ice']['processor']['local_dir']}/#{dir}_AWS Import" do
owner node['tomcat']['user']
group node['tomcat']['group']
Expand Down Expand Up @@ -104,7 +104,7 @@
frequency node['ice']['logrotate_frequency']
rotate node['ice']['logrotate_rotate']
create "640 #{node['tomcat']['base_instance']} adm"
options %w( copytruncate compress missingok )
options %w(copytruncate compress missingok)
end

include_recipe 'ice::nginx' if node['ice']['reader']['enabled'] == true && node['ice']['nginx_enabled']
14 changes: 7 additions & 7 deletions recipes/nginx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

# Configure nginx site reverse proxy
if node['ice']['public_hostname'].nil?
if node.attribute?('ec2')
node.override['ice']['public_hostname'] = node['ec2']['public_hostname']
elsif node.attribute?('cloud')
node.override['ice']['public_hostname'] = node['cloud']['public_hostname']
else
node.override['ice']['public_hostname'] = node['fqdn']
end
node.override['ice']['public_hostname'] = if node.attribute?('ec2')
node['ec2']['public_hostname']
elsif node.attribute?('cloud')
node['cloud']['public_hostname']
else
node['fqdn']
end

if node['ice']['nginx_port'] != 80
node.override['ice']['public_hostname'] += ":#{node['ice']['nginx_port']}"
Expand Down