Skip to content

Commit

Permalink
[COOK-3267] - Improving tests, updating kitchen scaffolding, improvin…
Browse files Browse the repository at this point in the history
…g style
  • Loading branch information
Sean OMeara committed Dec 18, 2013
1 parent 4efa69c commit 49e35a9
Show file tree
Hide file tree
Showing 18 changed files with 448 additions and 418 deletions.
73 changes: 49 additions & 24 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,67 @@
---
driver_plugin: vagrant
driver_plugin: digitalocean
driver_config:
require_chef_omnibus: 11.4.4
digitalocean_client_id: <%= ENV['DIGITAL_OCEAN_CLIENT_ID'] %>
digitalocean_api_key: <%= ENV['DIGITAL_OCEAN_API_KEY'] %>
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %>
ssh_key: <%= ENV['AWS_PRIVATE_KEY_PATH'] %>
rackspace_username: <%= ENV['RACKSPACE_USERNAME'] %>
rackspace_api_key: <%= ENV['RACKSPACE_API_KEY'] %>
require_chef_omnibus: latest

platforms:
- name: ubuntu-12.10
- name: centos-5.8
driver_plugin: digitalocean
driver_config:
box: opscode-ubuntu-12.10
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.10_provisionerless.box
run_list: ["recipe[apt]"]
image_id: 1601
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>

- name: ubuntu-12.04
- name: centos-6.4
driver_plugin: digitalocean
driver_config:
box: opscode-ubuntu-12.04
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box
run_list: ["recipe[apt]"]
image_id: 562354
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>

- name: ubuntu-10.04
- name: amazon-2013.09
driver_plugin: ec2
driver_config:
box: opscode-ubuntu-10.04
box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_provisionerless.box
run_list: ["recipe[apt]"]
image_id: ami-3be4bc52
username: ec2-user

- name: debian-6
driver_config:
box: opscode-debian-6
box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_debian-6.0.7_provisionerless.box
run_list: ["recipe[apt]"]
# - name: fedora-19
# driver_plugin: digitalocean
# driver_config:
# image_id: 696598
# flavor_id: 63
# region_id: 1
# ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>

- name: centos-5.9
- name: ubuntu-1004
driver_plugin: digitalocean
driver_config:
box: opscode-centos-5.9
box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box
image_id: 14097
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
run_list:
- recipe[apt]

- name: centos-6.4
- name: ubuntu-1204
driver_plugin: digitalocean
driver_config:
box: opscode-centos-6.4
box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box
image_id: 284203
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
run_list:
- recipe[apt]

suites:
- name: default
Expand Down
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Encoding:
Enabled: false

LineLength:
Max: 200

HashSyntax:
EnforcedStyle: hash_rockets
16 changes: 11 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
source 'https://rubygems.org'

group :test do
gem 'chef'
gem 'rake'
gem 'rspec'
gem 'foodcritic'
gem 'berkshelf', '~> 2.0'
gem 'chefspec', '~> 3.0'
gem 'foodcritic', '~> 3.0'
gem 'rubocop'

group :integration do
gem 'test-kitchen', '~> 1.0'
gem 'kitchen-vagrant', '~> 0.11'
gem 'kitchen-digitalocean'
gem 'kitchen-ec2'
end

90 changes: 41 additions & 49 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,59 @@
#
# Copyright 2008-2009, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

case node["platform_family"]
when "debian"

default["runit"]["sv_bin"] = "/usr/bin/sv"
default["runit"]["chpst_bin"] = "/usr/bin/chpst"
default["runit"]["service_dir"] = "/etc/service"
default["runit"]["sv_dir"] = "/etc/sv"
default["runit"]["lsb_init_dir"] = "/etc/init.d"
default["runit"]["executable"] = "/sbin/runit"

if node["platform"] == "debian"

default["runit"]["start"] = "runsvdir-start"
default["runit"]["stop"] = ""
default["runit"]["reload"] = ""

elsif node["platform"] == "ubuntu"

default["runit"]["start"] = "start runsvdir"
default["runit"]["stop"] = "stop runsvdir"
default["runit"]["reload"] = "reload runsvdir"

case node['platform_family']
when 'debian'
default['runit']['sv_bin'] = '/usr/bin/sv'
default['runit']['chpst_bin'] = '/usr/bin/chpst'
default['runit']['service_dir'] = '/etc/service'
default['runit']['sv_dir'] = '/etc/sv'
default['runit']['lsb_init_dir'] = '/etc/init.d'
default['runit']['executable'] = '/sbin/runit'

if node['platform'] == 'debian'
default['runit']['start'] = 'runsvdir-start'
default['runit']['stop'] = ''
default['runit']['reload'] = ''
elsif node['platform'] == 'ubuntu'
default['runit']['start'] = 'start runsvdir'
default['runit']['stop'] = 'stop runsvdir'
default['runit']['reload'] = 'reload runsvdir'
end

when "rhel"

default["runit"]["sv_bin"] = "/sbin/sv"
default["runit"]["chpst_bin"] = "/sbin/chpst"
default["runit"]["service_dir"] = "/etc/service"
default["runit"]["sv_dir"] = "/etc/sv"
default["runit"]["lsb_init_dir"] = "/etc/init.d"
default["runit"]["executable"] = "/sbin/runit"
default["runit"]["use_package_from_yum"] = false

default["runit"]["start"] = "/etc/init.d/runit-start start"
default["runit"]["stop"] = "/etc/init.d/runit-start stop"
default["runit"]["reload"] = "/etc/init.d/runit-start reload"

when "gentoo"

default["runit"]["sv_bin"] = "/usr/bin/sv"
default["runit"]["chpst_bin"] = "/usr/bin/chpst"
default["runit"]["service_dir"] = "/var/service"
default["runit"]["sv_dir"] = "/etc/sv"
default["runit"]["lsb_init_dir"] = "/etc/init.d"
default["runit"]["executable"] = "/sbin/runit"
default["runit"]["start"] = "/etc/init.d/runit-start start"
default["runit"]["stop"] = "/etc/init.d/runit-start stop"
default["runit"]["reload"] = "/etc/init.d/runit-start reload"
when 'rhel'
default['runit']['sv_bin'] = '/sbin/sv'
default['runit']['chpst_bin'] = '/sbin/chpst'
default['runit']['service_dir'] = '/etc/service'
default['runit']['sv_dir'] = '/etc/sv'
default['runit']['lsb_init_dir'] = '/etc/init.d'
default['runit']['executable'] = '/sbin/runit'
default['runit']['use_package_from_yum'] = false
default['runit']['start'] = '/etc/init.d/runit-start start'
default['runit']['stop'] = '/etc/init.d/runit-start stop'
default['runit']['reload'] = '/etc/init.d/runit-start reload'

when 'gentoo'
default['runit']['sv_bin'] = '/usr/bin/sv'
default['runit']['chpst_bin'] = '/usr/bin/chpst'
default['runit']['service_dir'] = '/var/service'
default['runit']['sv_dir'] = '/etc/sv'
default['runit']['lsb_init_dir'] = '/etc/init.d'
default['runit']['executable'] = '/sbin/runit'
default['runit']['start'] = '/etc/init.d/runit-start start'
default['runit']['stop'] = '/etc/init.d/runit-start stop'
default['runit']['reload'] = '/etc/init.d/runit-start reload'

end
Loading

0 comments on commit 49e35a9

Please sign in to comment.