Skip to content

Commit

Permalink
Updated rs-base to include yum-epel, so that collectd will install on…
Browse files Browse the repository at this point in the history
… centos7 (#38)

* adding yum-epel for rhel platforms

* fixing cookstyle for 1.2.22, and adding exclude for guard clause

* updating ephemeral_lvm to 3.0+

* updating berksfile lock

* updating chefdk to 1.2.22
  • Loading branch information
rshade authored Feb 27, 2017
1 parent 501761b commit 5d66d7b
Show file tree
Hide file tree
Showing 31 changed files with 55 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ AllCops:
Exclude:
- 'berks-cookbooks/**/*'
- 'knife.rb'
Style/GuardClause:
Exclude:
- 'recipes/monitoring_collectd.rb'
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: ruby
rvm:
- 2.3.1
before_install:
- curl -L https://www.getchef.com/chef/install.sh | sudo bash -s -- -P chefdk -v 1.0.3
- curl -L https://www.getchef.com/chef/install.sh | sudo bash -s -- -P chefdk -v 1.2.22
- gem install bundler -v 1.11.2
install:
- chef exec bundle install --jobs=3 --retry=3
Expand Down
2 changes: 1 addition & 1 deletion Berksfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true
source 'https://supermarket.chef.io'
metadata

cookbook 'collectd'
cookbook 'marker', github: 'rightscale-cookbooks/marker'
cookbook 'rightscale_tag', github: 'rightscale-cookbooks/rightscale_tag'
cookbook 'machine_tag', github: 'rightscale-cookbooks/machine_tag'
cookbook 'ephemeral_lvm', github: 'rightscale-cookbooks/ephemeral_lvm'

group :integration do
cookbook 'fake', path: './test/cookbooks/fake'
Expand Down
15 changes: 7 additions & 8 deletions Berksfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
DEPENDENCIES
collectd
ephemeral_lvm
git: https://github.com/rightscale-cookbooks/ephemeral_lvm.git
revision: 959b9a103620ce8a63988368d12912850df47b56
fake
path: test/cookbooks/fake
machine_tag
Expand Down Expand Up @@ -31,17 +28,19 @@ GRAPH
collectd_plugins (2.1.3)
collectd (~> 2.0)
compat_resource (12.16.3)
ephemeral_lvm (2.0.0)
lvm (~> 3.1)
ephemeral_lvm (3.0.0)
lvm (>= 4.0)
now (>= 0.0.0)
fake (0.1.0)
lvm (3.1.0)
lvm (4.0.5)
machine_tag (2.0.1)
apt (>= 0.0.0)
build-essential (>= 0.0.0)
marker (2.0.0)
mingw (1.2.5)
compat_resource (>= 12.16.3)
seven_zip (>= 0.0.0)
now (1.0.0)
ntp (3.3.1)
ohai (4.2.3)
compat_resource (>= 12.14.7)
Expand All @@ -51,11 +50,11 @@ GRAPH
rightscale_tag (2.0.0)
machine_tag (~> 2.0)
marker (~> 2.0)
rs-base (2.0.0)
rs-base (2.0.1)
apt (>= 0.0.0)
collectd (~> 2.2.2)
collectd_plugins (~> 2.1.3)
ephemeral_lvm (= 2.0.0)
ephemeral_lvm (~> 3.0)
machine_tag (~> 2.0)
marker (>= 0.0.0)
ntp (>= 0.0.0)
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ rs-base Cookbook CHANGELOG

This file is used to list changes made in each version of the rs-base cookbook.

v2.0.1
------
- add support for collectd on centos/rhel 7 by enabling epel repo

v2.0.0
------
- adding support for chef12
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org'

gem 'rake'
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rspec/core/rake_task'
require 'foodcritic'
require 'kitchen'
Expand Down Expand Up @@ -76,7 +77,7 @@ desc 'runs foodcritic linttask'
task :fc_new do
FoodCritic::Rake::LintTask.new(:chef) do |t|
t.options = {
fail_tags: ['any']
fail_tags: ['any'],
}
end
end
Expand Down
1 change: 1 addition & 0 deletions Thorfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

require 'bundler'
require 'bundler/setup'
Expand Down
13 changes: 7 additions & 6 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# -*- mode: ruby -*-
# vi: set ft=ruby :

Expand Down Expand Up @@ -72,25 +73,25 @@ Vagrant.configure('2') do |config|
config.vm.provision :chef_solo do |chef|
chef.json = {
'rs-base' => {
'collectd_server' => 'sketchy1-66.rightscale.com'
'collectd_server' => 'sketchy1-66.rightscale.com',
},
'cloud' => {
'public_ips' => [
nil,
'',
'33.33.33.10'
'33.33.33.10',
],
'private_ips' => [
nil,
'',
'10.0.2.15'
]
}
'10.0.2.15',
],
},
}

chef.run_list = [
'recipe[apt]',
'recipe[rs-base::default]'
'recipe[rs-base::default]',
]
end
end
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Attributes:: default
Expand Down
1 change: 1 addition & 0 deletions attributes/monitoring.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Attribute:: collectd
Expand Down
3 changes: 2 additions & 1 deletion attributes/ntp.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Attributes:: ntp
Expand All @@ -20,5 +21,5 @@
default['rs-base']['ntp']['servers'] = [
'time.rightscale.com',
'ec2-us-east.time.rightscale.com',
'ec2-us-west.time.rightscale.com'
'ec2-us-west.time.rightscale.com',
]
1 change: 1 addition & 0 deletions attributes/rsyslog.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Attributes:: rsyslog
Expand Down
1 change: 1 addition & 0 deletions attributes/swap.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Attributes:: swap
Expand Down
7 changes: 4 additions & 3 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# frozen_string_literal: true
name 'rs-base'
maintainer 'RightScale, Inc.'
maintainer_email '[email protected]'
license 'Apache 2.0'
description 'Installs/Configures rs-base'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.0.0'
version '2.0.1'
issues_url 'https://github.com/rightscale-cookbooks/rs-base/issues' if respond_to?(:issues_url)
source_url 'https://github.com/rightscale-cookbooks/rs-base' if respond_to?(:source_url)
chef_version '>= 12.0' if respond_to?(:chef_version)
Expand All @@ -22,7 +23,7 @@
depends 'rsyslog'
depends 'collectd', '~> 2.2.2'
depends 'collectd_plugins', '~> 2.1.3'
depends 'ephemeral_lvm', '2.0'
depends 'ephemeral_lvm', '~> 3.0'

recipe 'rs-base::default', 'All-in-one recipe to run all recipes in rs-base cookbook.'
recipe 'rs-base::ntp', 'Installs and configures ntp client.'
Expand All @@ -42,7 +43,7 @@
default: [
'time.rightscale.com',
'ec2-us-east.time.rightscale.com',
'ec2-us-west.time.rightscale.com'
'ec2-us-west.time.rightscale.com',
]

attribute 'rs-base/swap/size',
Expand Down
1 change: 1 addition & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Recipe:: default
Expand Down
3 changes: 3 additions & 0 deletions recipes/monitoring_collectd.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Recipe:: collectd
Expand All @@ -21,6 +22,8 @@
template 'rightscale_audit_entry.erb'
end

include_recipe 'yum-epel' if node['platform_family'] == 'rhel'

Chef::Log.info 'setting collectd defaults'
node.default['collectd']['service']['configuration']['Hostname'] = node['rs-base']['collectd_hostname']
node.default['collectd']['service']['configuration']['F_Q_D_N_Lookup'] = false
Expand Down
1 change: 1 addition & 0 deletions recipes/monitoring_rightlink.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Recipe:: collectd
Expand Down
1 change: 1 addition & 0 deletions recipes/ntp.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Recipe:: ntp
Expand Down
1 change: 1 addition & 0 deletions recipes/rsyslog.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Recipe:: rsyslog
Expand Down
1 change: 1 addition & 0 deletions recipes/swap.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-base
# Recipe:: swap
Expand Down
1 change: 1 addition & 0 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'spec_helper'

describe 'rs-base::default' do
Expand Down
1 change: 1 addition & 0 deletions spec/monitoring_collectd_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'spec_helper'

describe 'rs-base::monitoring_collectd' do
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: rs-haproxy
# Spec:: spec_helper
Expand Down
1 change: 1 addition & 0 deletions spec/swap_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'spec_helper'

describe 'rs-base::swap' do
Expand Down
1 change: 1 addition & 0 deletions test/cookbooks/fake/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
name 'fake'
maintainer 'RightScale, Inc.'
maintainer_email '[email protected]'
Expand Down
1 change: 1 addition & 0 deletions test/cookbooks/fake/recipes/create_secrets.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
directory '/var/run/rightlink' do
owner 'root'
group 'root'
Expand Down
1 change: 1 addition & 0 deletions test/cookbooks/fake/recipes/rightscale_software.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: fake
# Recipe:: rightscale_software
Expand Down
1 change: 1 addition & 0 deletions test/cookbooks/fake/recipes/tcpdump.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
#
# Cookbook Name:: fake
# Recipe:: tcpdump
Expand Down
1 change: 1 addition & 0 deletions test/integration/collectd/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# frozen_string_literal: true
require 'serverspec'
1 change: 1 addition & 0 deletions test/integration/collectd/serverspec/version_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe package('collectd') do
Expand Down

0 comments on commit 5d66d7b

Please sign in to comment.