Get initial build to work.
Add .gitreview, Gemfile, .rubocop.yml, Berksfile, Strainerfile Fixed style errors. Added empty unit test so chef-unit passes until we get real unit tests Change-Id: I75a9449a28cfc294eacbdc0003a8b7de2613290e
This commit is contained in:
parent
6e84937a64
commit
5ce5e04f51
4
.gitreview
Normal file
4
.gitreview
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[gerrit]
|
||||||
|
host=review.openstack.org
|
||||||
|
port=29418
|
||||||
|
project=stackforge/cookbook-monasca-notification
|
24
.rubocop.yml
Normal file
24
.rubocop.yml
Normal 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
|
11
Gemfile
Normal file
11
Gemfile
Normal 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
5
Strainerfile
Normal 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
|
@ -1,2 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
# Logs to backup
|
# Logs to backup
|
||||||
node.default[:mon_log_backup][:logs][:mon_notification] = [ '/var/log/mon-notification/notification.log' ]
|
node.default[:mon_log_backup][:logs][:mon_notification] =
|
||||||
|
['/var/log/mon-notification/notification.log']
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
|
#
|
||||||
default[:mon_notification][:user] = 'mon-notification'
|
default[:mon_notification][:user] = 'mon-notification'
|
||||||
default[:mon_notification][:group] = 'mon-notification'
|
default[:mon_notification][:group] = 'mon-notification'
|
||||||
default[:mon_notification][:conf_dir] = '/etc/mon'
|
default[:mon_notification][:conf_dir] = '/etc/mon'
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
# Have ossec watch the log
|
# Have ossec watch the log
|
||||||
node.default[:ossec][:watched][:mon_notification] = {
|
node.default[:ossec][:watched][:mon_notification] = {
|
||||||
'/var/log/mon-notification/notification.log' => :syslog
|
'/var/log/mon-notification/notification.log' => :syslog
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
|
#
|
||||||
name 'mon_notification'
|
name 'mon_notification'
|
||||||
maintainer 'HP Monitoring'
|
maintainer 'HP Monitoring'
|
||||||
maintainer_email 'hpcs-mon@hp.com'
|
maintainer_email 'hpcs-mon@hp.com'
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
include_recipe "python"
|
# encoding: UTF-8
|
||||||
|
#
|
||||||
|
include_recipe 'python'
|
||||||
|
|
||||||
# preferable for the OS to install this then to have pip compile
|
# preferable for the OS to install this then to have pip compile
|
||||||
%w[ python-mysqldb libmysqlclient-dev ].each do |pkg_name|
|
%w[ python-mysqldb libmysqlclient-dev ].each do |pkg_name|
|
||||||
@ -47,7 +49,7 @@ directory node[:mon_notification][:log_dir] do
|
|||||||
mode 0775
|
mode 0775
|
||||||
end
|
end
|
||||||
|
|
||||||
# todo - setup an encrypted data bag for credentials
|
# TODO: setup an encrypted data bag for credentials
|
||||||
hosts = data_bag_item(node[:mon_notification][:data_bag], 'hosts')
|
hosts = data_bag_item(node[:mon_notification][:data_bag], 'hosts')
|
||||||
template "#{node[:mon_notification][:conf_dir]}/notification.yaml" do
|
template "#{node[:mon_notification][:conf_dir]}/notification.yaml" do
|
||||||
action :create
|
action :create
|
||||||
@ -56,7 +58,7 @@ template "#{node[:mon_notification][:conf_dir]}/notification.yaml" do
|
|||||||
group node[:mon_notification][:group]
|
group node[:mon_notification][:group]
|
||||||
mode 0640
|
mode 0640
|
||||||
variables(
|
variables(
|
||||||
:hosts => hosts
|
hosts: hosts
|
||||||
)
|
)
|
||||||
notifies :restart, "service[mon-notification]"
|
notifies :restart, 'service[mon-notification]'
|
||||||
end
|
end
|
||||||
|
2
spec/empty.rb
Normal file
2
spec/empty.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
|
# No unit tests at this time.
|
Loading…
Reference in New Issue
Block a user