Get initial build to work.

Add .gitreview, Gemfile, .rubocop.yml, Berksfile, and Strainerfile.

Fixed style errors.

Added empty unit test so chef-unit passes until we get real unit tests.

Change-Id: I7e34f46e56e14aa9897b7f7fcad545e9c723412c
This commit is contained in:
Craig Bryant 2014-07-16 17:59:18 -06:00
parent e332e7eca7
commit d22a345b65
9 changed files with 74 additions and 21 deletions

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=stackforge/cookbook-monasca-persister

24
.rubocop.yml Normal file
View File

@ -0,0 +1,24 @@
AllCops:
Includes:
- metadata.rb
- Gemfile
- attributes/**
- libraries/**
- providers/**
- recipes/**
- resources/**
- spec/**
Encoding:
Exclude:
- metadata.rb
- Gemfile
NumericLiterals:
Enabled: false
LineLength:
Enabled: false
WordArray:
MinSize: 3

1
Berksfile Normal file
View File

@ -0,0 +1 @@
metadata

11
Gemfile Normal file
View File

@ -0,0 +1,11 @@
source 'https://rubygems.org'
gem 'chef', '~> 11.8'
gem 'json', '<= 1.7.7' # chef 11 dependency
gem 'berkshelf', '~> 2.0.18'
gem 'hashie', '~> 2.0'
gem 'chefspec', '~> 3.4.0'
gem 'rspec', '~> 2.14.1'
gem 'foodcritic', '~> 3.0.3'
gem 'strainer'
gem 'rubocop', '~> 0.18.1'

5
Strainerfile Normal file
View File

@ -0,0 +1,5 @@
# Strainerfile
rubocop: rubocop $SANDBOX/$COOKBOOK
knife test: knife cookbook test $COOKBOOK
foodcritic: foodcritic -f any -t ~FC003 -t ~FC023 $SANDBOX/$COOKBOOK
chefspec: rspec $SANDBOX/$COOKBOOK/spec

View File

@ -1,8 +1,10 @@
# encoding: UTF-8#
#
node.default[:mon_persister][:group] = 'persister'
node.default[:mon_persister][:data_bag] = 'mon_persister'
#Sysctl settings
#This style is picked up by the sysctl cookbook in HP Cloud basenode
# Sysctl settings
# This style is picked up by the sysctl cookbook in HP Cloud basenode
node.default[:sysctl]['net.core.rmem_max'] = '16777216'
#This style is used by the sysctl community cookbook
# This style is used by the sysctl community cookbook
node.default[:sysctl][:params][:net][:core][:rmem_max] = '16777216'

View File

@ -1,7 +1,9 @@
# encoding: UTF-8#
#
name 'mon_persister'
maintainer "Monitoring Team"
maintainer_email "hpcs-mon@hp.com"
license "All rights reserved"
description "Installs/Configures som_persister"
maintainer 'Monitoring Team'
maintainer_email 'hpcs-mon@hp.com'
license 'All rights reserved'
description 'Installs/Configures som_persister'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.1.17"
version '0.1.17'

View File

@ -1,4 +1,6 @@
package 'mon-persister' do #The package depends on openjdk-7-jre
# encoding: UTF-8#
#
package 'mon-persister' do # The package depends on openjdk-7-jre
action :upgrade
end
@ -8,15 +10,15 @@ service 'mon-persister' do
end
# Create the log file directory
directory "/var/log/mon" do
recursive true
owner "persister"
group node[:mon_persister][:group]
mode 0755
action :create
directory '/var/log/mon' do
recursive true
owner 'persister'
group node[:mon_persister][:group]
mode 0755
action :create
end
# Todo encrypt the credentials data bag item
# TODO: encrypt the credentials data bag item
credentials = data_bag_item(node[:mon_persister][:data_bag], 'mon_credentials')
settings = data_bag_item(node[:mon_persister][:data_bag], 'mon_persister')
@ -24,11 +26,11 @@ template '/etc/mon/persister-config.yml' do
action :create
owner 'root'
group node[:mon_persister][:group]
mode "640"
source "persister-config.yml.erb"
mode '640'
source 'persister-config.yml.erb'
variables(
:credentials => credentials,
:settings => settings
credentials: credentials,
settings: settings
)
notifies :restart, "service[mon-persister]"
notifies :restart, 'service[mon-persister]'
end

2
spec/empty.rb Normal file
View File

@ -0,0 +1,2 @@
# encoding: UTF-8
# No unit tests at this time.