Permalink
Browse files

Updating test-harness, fixing up style cops, adding amazon linux supp…

…ort to Omnitruck library
  • Loading branch information...
1 parent d376054 commit d41807a4c6fae4014524757ead2792b11f66a044 @someara someara committed Feb 24, 2014
Showing with 581 additions and 100 deletions.
  1. +5 −4 .gitignore
  2. +68 −0 .kitchen.cloud.yml
  3. +17 −0 .rubocop.yml
  4. +82 −0 .travis.yml
  5. +2 −0 Berksfile
  6. +37 −0 Gemfile
  7. +35 −0 Guardfile
  8. +59 −0 Rakefile
  9. +177 −15 TESTING.md
  10. +1 −1 attributes/default.rb
  11. +15 −16 libraries/dev_helper.rb
  12. +14 −7 libraries/omnitruck_client.rb
  13. +11 −9 metadata.rb
  14. +30 −28 recipes/default.rb
  15. +24 −20 recipes/dev.rb
  16. +4 −0 spec/spec_helper.rb
View
9 .gitignore
@@ -1,5 +1,3 @@
-.bundle
-.cache
.vagrant
Berksfile.lock
Gemfile.lock
@@ -9,6 +7,9 @@ Gemfile.lock
\#*#
.*.sw[a-z]
*.un~
-/cookbooks
-/bin
+.bundle
+.cache
.kitchen
+bin
+.kitchen.local.yml
+.coverage
View
68 .kitchen.cloud.yml
@@ -0,0 +1,68 @@
+---
+driver_config:
+ 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'] %>
+
+provisioner:
+ name: chef_zero
+ require_chef_omnibus: latest
+
+platforms:
+- name: centos-5.8
+ driver_plugin: digitalocean
+ driver_config:
+ image_id: 1601
+ flavor_id: 63
+ region_id: 4
+ ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
+ ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
+
+- name: centos-6.4
+ driver_plugin: digitalocean
+ driver_config:
+ image_id: 562354
+ flavor_id: 63
+ region_id: 4
+ ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
+ ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
+
+# - name: amazon-2013.09
+# driver_plugin: ec2
+# driver_config:
+# image_id: ami-3be4bc52
+# username: ec2-user
+# ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
+
+- name: ubuntu-1004
+ driver_plugin: digitalocean
+ driver_config:
+ image_id: 14097
+ flavor_id: 63
+ region_id: 4
+ ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
+ ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
+ run_list:
+ - recipe[apt]
+
+- name: ubuntu-1204
+ driver_plugin: digitalocean
+ driver_config:
+ image_id: 1505447
+ flavor_id: 63
+ region_id: 4
+ ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
+ ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
+ run_list:
+ - recipe[apt]
+
+suites:
+- name: default
+ run_list:
+ - recipe[fqdn]
+ - recipe[chef-server::default]
+ attributes:
+ machine_fqdn: chef.computers.biz
+ fqdn_as_hostname: true
View
17 .rubocop.yml
@@ -0,0 +1,17 @@
+AlignParameters:
+ Enabled: false
+
+Encoding:
+ Enabled: false
+
+LineLength:
+ Max: 200
+
+MethodLength:
+ Enabled: false
+
+RescueModifier:
+ Enabled: false
+
+HashSyntax:
+ EnforcedStyle: hash_rockets
View
82 .travis.yml
@@ -0,0 +1,82 @@
+language: ruby
+bundler_args: --without kitchen_vagrant --without development
+rvm:
+- 2.1.0
+before_install:
+- echo -n $DO_KEY_CHUNK_{0..30} >> ~/.ssh/id_do.base64
+- cat ~/.ssh/id_do.base64 | tr -d ' ' | base64 --decode > ~/.ssh/id_do.pem
+- echo -n $EC2_KEY_CHUNK_{0..30} >> ~/.ssh/id_ec2.base64
+- cat ~/.ssh/id_ec2.base64 | tr -d ' ' | base64 --decode > ~/.ssh/id_ec2.pem
+script:
+- bundle exec rake style
+- bundle exec rake spec
+- bundle exec kitchen test $KITCHEN_INSTANCE
+after_script:
+- bundle exec kitchen destroy
+env:
+ global:
+ - secure: fZl+EutqQhA9Pbx+PfDuLxTkQi6Rjn8gq/0r8Tv1lra8Wvy+0URWQJw0jiq7Xa6q9humacH0rBbxZSI2neeL507c3YF7wzQ5sGIgwx0BzOBXwmhDlgnAaPR2JnRCcPlK7LvlRDC2b+UpVVYXwI8h4uci+2p3UTTurqAfIHc4zTo=
+ - secure: MhrZ8foxMCCi+xhD4MzvaU0y1aTXuCVcXOtRelsTG5J9GPAGiCDaMhrmeftkz07w5fQApaXCglFBK/3oQfKN5tyvUEVT/js0PEJarE0Y0pxoNiUJt8WLPvp+6m0RYm+z5u3BtrbMilCbpDiN9NGcQH7vSndCRLALHM+afssLisg=
+ - secure: t8eo7m8V6L8KQ5VojMXv0wiku1uDW50QNCM3x3+Ji9WlltNHChhCS3J+LRk5kjxlZKNTbcUB0Nyz0WrTigfGPty4B85SAwztcC39R+IWKKOSoyiiHKu9zK2O1Tu2hh5Guq1Ac5ORJ8jHJNBZHPN+TFGZZzFIsM2jJoo7uO2NJEw=
+ - secure: NVQUakxXIFvYFcwEld5HCiANdmpmm+pIrcutODIzri1JaksRV2dRqMu5YgW9o0H2QqgGm1rAXpn+oTOtR/S3AmWZLw17Fmz6aL74bAHn7IQYsxfehDha9W6afKQ0R9XD6H2X+yjDA8x/4IAh5Uip1vQlmZEsykhC5DuMj6nRJbI=
+ - secure: Rns8W/sXi33QR4IDy/FogOnHGGIe1Ipm7ak4KU5yI1Ek1NbcoQ+OcnUvgNRo75PsyLj+10ZCtipPLs4AQUi6yAEnciK6W6tKSbGy3Hw8tHeuy+8fEtA4rSKmwVzFWyApdOaXUfmFnkW26hZNIJExvHg1ikpAmngPh142JV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i3h9lRmOSXLBmJA5veaWhqlOs=
+ - secure: A/YwNUlqJNyC37HfhbXEIHAQKRI/gmnD2Sq5yzCLyBYDfSOlB1b3xDIcaa93ohqnqvzmZyxSw1qxcGrodqYNpqYw8f2Q7LMpy7jl9pfzRO1YoRF+h/X3XPbEnop23YHvsSN6Q3R7Wug+vWZNNr3F/68EXiuJjSnTl+o3+9Hq7IQ=
+ matrix:
+ - KITCHEN_INSTANCE='default-centos-58'
+ - KITCHEN_INSTANCE='default-centos-64'
+ - KITCHEN_INSTANCE='default-ubuntu-1004'
+ - KITCHEN_INSTANCE='default-ubuntu-1204'
View
2 Berksfile
@@ -4,4 +4,6 @@ metadata
group :dev do
cookbook 'git'
+ cookbook 'apt'
+ cookbook 'fqdn'
end
View
37 Gemfile
@@ -0,0 +1,37 @@
+source 'https://rubygems.org'
+
+group :lint do
+ gem 'foodcritic', '~> 3.0'
+ gem 'rubocop', '~> 0.18'
+ gem 'rainbow', '< 2.0'
+end
+
+group :unit do
+ gem 'berkshelf', '~> 3.0.0.beta6'
+ gem 'chefspec', '~> 3.1'
+end
+
+group :kitchen_common do
+ gem 'test-kitchen', '~> 1.2'
+end
+
+group :kitchen_vagrant do
+ gem 'kitchen-vagrant', '~> 0.11'
+end
+
+group :kitchen_cloud do
+ gem 'kitchen-digitalocean'
+ gem 'kitchen-ec2'
+end
+
+group :development do
+ gem 'ruby_gntp'
+ gem 'growl'
+ gem 'rb-fsevent'
+ gem 'guard', '~> 2.4'
+ gem 'guard-kitchen'
+ gem 'guard-foodcritic'
+ gem 'guard-rspec'
+ gem 'guard-rubocop'
+ gem 'rake'
+end
View
35 Guardfile
@@ -0,0 +1,35 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+# guard 'kitchen' do
+# watch(%r{test/.+})
+# watch(%r{^recipes/(.+)\.rb$})
+# watch(%r{^attributes/(.+)\.rb$})
+# watch(%r{^files/(.+)})
+# watch(%r{^templates/(.+)})
+# watch(%r{^providers/(.+)\.rb})
+# watch(%r{^resources/(.+)\.rb})
+# end
+
+guard 'foodcritic', cookbook_paths: '.', all_on_start: false do
+ watch(%r{attributes/.+\.rb$})
+ watch(%r{providers/.+\.rb$})
+ watch(%r{recipes/.+\.rb$})
+ watch(%r{resources/.+\.rb$})
+ watch('metadata.rb')
+end
+
+guard 'rubocop', all_on_start: false do
+ watch(%r{attributes/.+\.rb$})
+ watch(%r{providers/.+\.rb$})
+ watch(%r{recipes/.+\.rb$})
+ watch(%r{resources/.+\.rb$})
+ watch('metadata.rb')
+end
+
+guard :rspec, cmd: 'bundle exec rspec', all_on_start: false, notification: false do
+ watch(%r{^libraries/(.+)\.rb$})
+ watch(%r{^spec/(.+)_spec\.rb$})
+ watch(%r{^(recipes)/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { 'spec' }
+end
View
59 Rakefile
@@ -0,0 +1,59 @@
+require 'rspec/core/rake_task'
+require 'rubocop/rake_task'
+require 'foodcritic'
+require 'kitchen'
+
+# Style tests. Rubocop and Foodcritic
+namespace :style do
+ desc 'Run Ruby style checks'
+ Rubocop::RakeTask.new(:ruby)
+
+ desc 'Run Chef style checks'
+ FoodCritic::Rake::LintTask.new(:chef) do |t|
+ t.options = {
+ fail_tags: ['any'],
+ tags: ['~FC005']
+ }
+ end
+end
+
+desc 'Run all style checks'
+task style: ['style:chef', 'style:ruby']
+
+# Rspec and ChefSpec
+desc "Run ChefSpec examples"
+RSpec::Core::RakeTask.new(:spec)
+
+# Integration tests. Kitchen.ci
+namespace :integration do
+ desc 'Run Test Kitchen with Vagrant'
+ task :vagrant do
+ Kitchen.logger = Kitchen.default_file_logger
+ Kitchen::Config.new.instances.each do |instance|
+ instance.test(:always)
+ end
+ end
+
+ desc 'Run Test Kitchen with cloud plugins'
+ task :cloud do
+ run_kitchen = true
+ if ENV['TRAVIS'] == 'true' && ENV['TRAVIS_PULL_REQUEST'] != 'false'
+ run_kitchen = false
+ end
+
+ if run_kitchen
+ Kitchen.logger = Kitchen.default_file_logger
+ @loader = Kitchen::Loader::YAML.new(project_config: './.kitchen.cloud.yml')
+ config = Kitchen::Config.new( loader: @loader)
+ config.instances.each do |instance|
+ instance.test(:always)
+ end
+ end
+ end
+end
+
+desc 'Run all tests on Travis'
+task travis: ['style', 'spec', 'integration:cloud']
+
+# Default
+task default: ['style', 'spec', 'integration:vagrant']
View
192 TESTING.md
@@ -1,25 +1,187 @@
-This cookbook includes support for running tests via Test Kitchen (1.0). This has some requirements.
+yum Cookbook TESTING doc
+========================
-1. You must be using the Git repository, rather than the downloaded cookbook from the Chef Community Site.
-2. You must have Vagrant 1.1 installed.
-3. You must have a "sane" Ruby 1.9.3 environment.
+Bundler
+-------
+A ruby environment with Bundler installed is a prerequisite for using
+the testing harness shipped with this cookbook. At the time of this
+writing, it works with Ruby 2.0 and Bundler 1.5.3. All programs
+involved, with the exception of Vagrant, can be installed by cd'ing
+into the parent directory of this cookbook and running "bundle install"
-Once the above requirements are met, install the additional requirements:
+Rakefile
+--------
+The Rakefile ships with a number of tasks, each of which can be ran
+individually, or in groups. Typing "rake" by itself will perform style
+checks with Rubocop and Foodcritic, ChefSpec with rspec, and
+integration with Test Kitchen using the Vagrant driver by
+default.Alternatively, integration tests can be ran with Test Kitchen
+cloud drivers.
-Install the berkshelf plugin for vagrant, and berkshelf to your local Ruby environment.
+```
+$ rake -T
+rake integration:cloud # Run Test Kitchen with cloud plugins
+rake integration:vagrant # Run Test Kitchen with Vagrant
+rake spec # Run ChefSpec examples
+rake style # Run all style checks
+rake style:chef # Lint Chef cookbooks
+rake style:ruby # Run Ruby style checks
+rake travis # Run all tests on Travis
+```
- vagrant plugin install vagrant-berkshelf
- gem install berkshelf
+Style Testing
+-------------
+Ruby style tests can be performed by Rubocop by issuing either
+```
+bundle exec rubocop
+```
+or
+```
+rake style:ruby
+```
-Install Test Kitchen 1.0 (unreleased yet, use the alpha / prerelease version).
+Chef style tests can be performed with Foodcritic by issuing either
+```
+bundle exec foodcritic
+```
+or
+```
+rake style:chef
+```
- gem install test-kitchen --pre
+Spec Testing
+-------------
+Unit testing is done by running Rspec examples. Rspec will test any
+libraries, then test recipes using ChefSpec. This works by compiling a
+recipe (but not converging it), and allowing the user to make
+assertions about the resource_collection.
-Install the Vagrant driver for Test Kitchen.
+Integration Testing
+-------------------
+Integration testing is performed by Test Kitchen. Test Kitchen will
+use either the Vagrant driver or various cloud drivers to instantiate
+machines and apply cookbooks. After a successful converge, tests are
+uploaded and ran out of band of Chef. Tests should be designed to
+ensure that a recipe has accomplished its goal.
- gem install kitchen-vagrant
+Integration Testing using Vagrant
+---------------------------------
+Integration tests can be performed on a local workstation using
+Virtualbox or VMWare. Detailed instructions for setting this up can be
+found at the [Bento](https://github.com/opscode/bento) project web site.
-Once the above are installed, you should be able to run Test Kitchen:
+Integration tests using Vagrant can be performed with either
+```
+bundle exec kitchen test
+```
+or
+```
+rake integration:vagrant
+```
+
+Integration Testing using Cloud providers
+-----------------------------------------
+Integration tests can be performed on cloud providers using
+Test Kitchen plugins. This cookbook ships a ```.kitchen.cloud.yml```
+that references environmental variables present in the shell that
+```kitchen test``` is ran from. These usually contain authentication
+tokens for driving IaaS APIs, as well as the paths to ssh private keys
+needed for Test Kitchen log into them after they've been created.
+
+Examples of environment variables being set in ```~/.bash_profile```:
+```
+# digital_ocean
+export DIGITAL_OCEAN_CLIENT_ID='your_bits_here'
+export DIGITAL_OCEAN_API_KEY='your_bits_here'
+export DIGITAL_OCEAN_SSH_KEY_IDS='your_bits_here'
+
+# aws
+export AWS_ACCESS_KEY_ID='your_bits_here'
+export AWS_SECRET_ACCESS_KEY='your_bits_here'
+export AWS_KEYPAIR_NAME='your_bits_here'
+
+# joyent
+export SDC_CLI_ACCOUNT='your_bits_here'
+export SDC_CLI_IDENTITY='your_bits_here'
+export SDC_CLI_KEY_ID='your_bits_here'
+```
+
+Integration tests using cloud drivers can be performed with either
+```
+export KITCHEN_YAML=.kitchen.cloud.yml
+bundle exec kitchen test
+```
+or
+```
+rake integration:cloud
+```
+
+Digital Ocean Hint
+------------------
+At the time of this writing, you cannot find the numerical values
+needed for your SSH_KEY_IDS from the GUI. Instead, you will need to
+access the API from the command line.
+
+ curl -L 'https://api.digitalocean.com/ssh_keys/?client_id=your_bits_here&api_key=your_bits_here'
+
+Words about .travis.yml
+-----------------------
+In order for Travis to perform integration tests on public cloud
+providers, two major things need to happen. First, the environment
+variables referenced by ```.kitchen.cloud.yml``` need to be made
+available. Second, the private half of the ssh keys needed to log into
+machines need to be dropped off on the machine.
+
+The first part is straight forward. The travis gem can encrypt
+environment variables against the public key on the Travis repository
+and add them to the .travis.yml.
+
+```
+gem install travis
+travis encrypt AWS_ACCESS_KEY_ID='your_bits_here' --add
+travis encrypt AWS_SECRET_ACCESS_'your_bits_here' --add
+travis encrypt AWS_KEYPAIR_NAME='your_bits_here' --add
+travis encrypt EC2_SSH_KEY_PATH='~/.ssh/id_ec2.pem' --add
+
+travis encrypt DIGITAL_OCEAN_CLIENT_ID='your_bits_here' --add
+travis encrypt DIGITAL_OCEAN_API_KEY='your_bits_here' --add
+travis encrypt DIGITAL_OCEAN_SSH_KEY_IDS='your_bits_here' --add
+travis encrypt DIGITAL_OCEAN_SSH_KEY_PATH='~/.ssh/id_do.pem' --add
+```
+
+The second part is a little more complicated. Travis ENV variables are
+restricted to 90 bytes, and will not fit an entire SSH key. This can
+be worked around by breaking them up into 90 byte chunks, stashing
+them into ENV variables, then digging them out in the
+```before_install``` section of .travis.yml
+
+Here is an AWK script to do the encoding.
+```
+base64 ~/.ssh/travisci_cook_digitalocean.pem | \
+awk '{
+ j=0;
+ for( i=1; i<length; i=i+90 ) {
+ system("travis encrypt DO_KEY_CHUNK_" j "=" substr($0, i, 90) " --add");
+ j++;
+ }
+}'
+
+base64 ~/.ssh/travisci_cook_ec2.pem | \
+awk '{
+ j=0;
+ for( i=1; i<length; i=i+90 ) {
+ system("travis encrypt EC2_KEY_CHUNK_" j "=" substr($0, i, 90)" --add");
+ j++;
+ }
+}'
+```
+
+Then in .travis.yml:
+```
+before_install:
+- echo -n $DO_KEY_CHUNK_{0..30} >> ~/.ssh/id_do.base64
+- cat ~/.ssh/id_do.base64 | tr -d ' ' | base64 --decode > ~/.ssh/id_do.pem
+ - echo -n $EC2_KEY_CHUNK_{0..30} >> ~/.ssh/id_ec2.base64
+ - cat ~/.ssh/id_ec2.base64 | tr -d ' ' | base64 --decode > ~/.ssh/id_ec2.pem
+```
- kitchen list
- kitchen test
View
2 attributes/default.rb
@@ -47,4 +47,4 @@
# }
# )
#
-default['chef-server']['configuration'] = Hash.new
+default['chef-server']['configuration'] = {}
View
31 libraries/dev_helper.rb
@@ -17,26 +17,26 @@
require 'mixlib/shellout'
+# DevHelper
module DevHelper
-
def self.omnibus_path
- "/opt/chef-server/bin:/opt/chef-server/embedded/bin:/opt/chef-server/embedded/jre/bin"
+ '/opt/chef-server/bin:/opt/chef-server/embedded/bin:/opt/chef-server/embedded/jre/bin'
end
def self.code_root
- "/opt/chef-server-dev/code"
+ '/opt/chef-server-dev/code'
end
def self.backup_root
- "/opt/chef-server-dev/backup"
+ '/opt/chef-server-dev/backup'
end
def self.omnibus_service_root
- "/opt/chef-server/embedded/service"
+ '/opt/chef-server/embedded/service'
end
+ # Project
class Project
-
attr_accessor :name, :options
attr_accessor :checkout_path, :omnibus_path
attr_accessor :build_command, :preserved_paths
@@ -61,16 +61,16 @@ def build_and_load
private
def build
- if build_command
- shell_out(options[:build_command], :cwd => checkout_path)
- end
+ shell_out(options[:build_command], :cwd => checkout_path) if build_command
end
def link
if File.exists?(omnibus_path) && !File.symlink?(omnibus_path)
- release_path = options.key?(:release_path) ?
- File.join(checkout_path, options[:release_path]) :
- checkout_path
+ if options.key?(:release_path)
+ release_path = File.join(checkout_path, options[:release_path])
+ else
+ release_path = checkout_path
+ end
FileUtils.mv(omnibus_path, DevHelper.backup_root)
FileUtils.ln_s(release_path, omnibus_path)
end
@@ -82,15 +82,14 @@ def configure
dest_path = File.join(omnibus_path, path)
if File.exists?(backup_path)
FileUtils.mkdir_p(File.dirname(dest_path))
- FileUtils.cp_r(backup_path, dest_path, {:remove_destination => true,
- :preserve => true})
+ FileUtils.cp_r(backup_path, dest_path, :remove_destination => true, :preserve => true)
end
end
end
- def shell_out(command, options={})
+ def shell_out(command, options = {})
default_opts = {
- :environment => {'PATH' => "#{DevHelper.omnibus_path}:#{ENV['PATH']}"},
+ :environment => { 'PATH' => "#{DevHelper.omnibus_path}:#{ENV['PATH']}" },
:live_stream => STDOUT
}
c = Mixlib::ShellOut.new(command, default_opts.merge(options))
View
21 libraries/omnitruck_client.rb
@@ -17,18 +17,26 @@
require 'uri'
+# OmnitruckClient
class OmnitruckClient
-
attr_reader :platform, :platform_version, :machine_architecture
def initialize(node)
- @platform = node['platform_family'] == "rhel" ? "el" : node['platform']
- @platform_version = node['platform_family'] == "rhel" ? node['platform_version'].to_i : node['platform_version']
+ @platform = node['platform_family'] == 'rhel' ? 'el' : node['platform']
+ if node['platform_family'] == 'rhel'
+ if node['platform'] == 'amazon'
+ @platform_version = '6'
+ else
+ @platform_version = node['platform_version'].to_i
+ end
+ else
+ @platform_version = node['platform_version']
+ end
@machine_architecture = node['kernel']['machine']
end
- def package_for_version(version, prerelease=false, nightly=false)
- url = "http://www.opscode.com/chef/download-server"
+ def package_for_version(version, prerelease = false, nightly = false)
+ url = 'http://www.opscode.com/chef/download-server'
url << "?p=#{platform}"
url << "&pv=#{platform_version}"
url << "&m=#{machine_architecture}"
@@ -46,7 +54,7 @@ def package_for_version(version, prerelease=false, nightly=false)
def redirect_target(url)
url = URI.parse(url)
http = Net::HTTP.new(url.host, url.port)
- if url.scheme == "https"
+ if url.scheme == 'https'
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
@@ -58,5 +66,4 @@ def redirect_target(url)
nil
end
end
-
end
View
20 metadata.rb
@@ -1,11 +1,13 @@
-name "chef-server"
-maintainer "Opscode, Inc."
-maintainer_email "cookbooks@opscode.com"
-license "Apache 2.0"
-description "Installs and configures Chef Server"
+name 'chef-server'
+maintainer 'Opscode, Inc.'
+maintainer_email 'cookbooks@opscode.com'
+license 'Apache 2.0'
+description 'Installs and configures Chef Server'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "2.0.2"
+version '2.0.2'
-%w{ ubuntu redhat centos fedora amazon scientific oracle }.each do |os|
- supports os
-end
+supports 'centos'
+supports 'amazon'
+supports 'ubuntu'
+
+depends 'git'
@BarthV
BarthV added a line comment Mar 19, 2014

Adding "depends 'git'" to metadata breaks chef-solo installation method described in readme.md !

Now you just can't download the master.tgz and run a chef-solo over it. You have to manually (or automaticly) resolve the git cookbook and its dependencies :

  • build-essential chef_handler dmg git runit windows yum yum-epel

Please update Readme ;-) or drop this dependency (if possible) to keep this very simple installation method possible.

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
View
58 recipes/default.rb
@@ -18,15 +18,17 @@
# Acquire the chef-server Omnibus package
if node['chef-server']['package_file'].nil? || node['chef-server']['package_file'].empty?
- omnibus_package = OmnitruckClient.new(node).package_for_version(node['chef-server']['version'],
- node['chef-server']['prereleases'],
- node['chef-server']['nightlies'])
+ omnibus_package = OmnitruckClient.new(node).package_for_version(
+ node['chef-server']['version'],
+ node['chef-server']['prereleases'],
+ node['chef-server']['nightlies']
+ )
unless omnibus_package
- err_msg = "Could not locate chef-server"
- err_msg << " pre-release" if node['chef-server']['prereleases']
- err_msg << " nightly" if node['chef-server']['nightlies']
+ err_msg = 'Could not locate chef-server'
+ err_msg << ' pre-release' if node['chef-server']['prereleases']
+ err_msg << ' nightly' if node['chef-server']['nightlies']
err_msg << " package matching version '#{node['chef-server']['version']}' for node."
- raise err_msg
+ fail err_msg
end
else
omnibus_package = node['chef-server']['package_file']
@@ -37,8 +39,8 @@
# Ensure :file_cache_path exists
directory Chef::Config[:file_cache_path] do
- owner "root"
- group "root"
+ owner 'root'
+ group 'root'
recursive true
action :create
end
@@ -54,52 +56,52 @@
action :create_if_missing
end
end
-# else we assume it's on the local machine
+ # else we assume it's on the local machine
else
package_local_path = omnibus_package
end
# install the platform package
package package_name do # ignore ~FC009 known bug in food critic causes this to trigger see Foodcritic Issue #137
source package_local_path
- provider case node["platform_family"]
- when "debian"; Chef::Provider::Package::Dpkg
- when "rhel"; Chef::Provider::Package::Rpm
+ provider case node['platform_family']
+ when 'debian' then Chef::Provider::Package::Dpkg
+ when 'rhel' then Chef::Provider::Package::Rpm
else
- raise RuntimeError("I don't know how to install chef-server packages for platform family '#{node["platform_family"]}'!")
+ fail RuntimeError("I don't know how to install chef-server packages for platform family '#{node["platform_family"]}'!")
end
action :install
- notifies :run, "execute[reconfigure-chef-server]"
+ notifies :run, 'execute[reconfigure-chef-server]'
end
# create the chef-server etc directory
-directory "/etc/chef-server" do
- owner "root"
- group "root"
+directory '/etc/chef-server' do
+ owner 'root'
+ group 'root'
recursive true
action :create
end
# create the initial chef-server config file
-template "/etc/chef-server/chef-server.rb" do
- source "chef-server.rb.erb"
- owner "root"
- group "root"
+template '/etc/chef-server/chef-server.rb' do
+ source 'chef-server.rb.erb'
+ owner 'root'
+ group 'root'
action :create
- notifies :run, "execute[reconfigure-chef-server]", :immediately
+ notifies :run, 'execute[reconfigure-chef-server]', :immediately
end
# reconfigure the installation
-execute "reconfigure-chef-server" do
- command "chef-server-ctl reconfigure"
+execute 'reconfigure-chef-server' do
+ command 'chef-server-ctl reconfigure'
action :nothing
end
-ruby_block "ensure node can resolve API FQDN" do
+ruby_block 'ensure node can resolve API FQDN' do
block do
- fe = Chef::Util::FileEdit.new("/etc/hosts")
+ fe = Chef::Util::FileEdit.new('/etc/hosts')
fe.insert_line_if_no_match(/#{node['chef-server']['api_fqdn']}/,
- "127.0.0.1 #{node['chef-server']['api_fqdn']}")
+ "127.0.0.1 #{node['chef-server']['api_fqdn']}")
fe.write_file
end
not_if { Resolv.getaddress(node['chef-server']['api_fqdn']) rescue false } # host resolves
View
44 recipes/dev.rb
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-include_recipe "git"
+include_recipe 'git'
repos = {
'chef_authn' => {},
@@ -24,34 +24,38 @@
'chef_wm' => {},
'erchef' => {
:service_name => 'erchef',
- :preserved_paths => ["etc/app.config",
- "log",
- "bin/erchef"],
- :build_command => "rebar get-deps && make clean relclean devrel",
- :release_path => "rel/erchef"
+ :preserved_paths => [
+ 'etc/app.config',
+ 'log',
+ 'bin/erchef'
+ ],
+ :build_command => 'rebar get-deps && make clean relclean devrel',
+ :release_path => 'rel/erchef'
},
'chef-server-webui' => {
:service_name => 'chef-server-webui',
- :preserved_paths => ["config/environments/chefserver.rb",
- "tmp",
- "config/initializers/secret_token.rb",
- "config/initializers/session_store.rb",
- "config.ru"],
- :build_command => "bundle install --deployment --without development"
+ :preserved_paths => [
+ 'config/environments/chefserver.rb',
+ 'tmp',
+ 'config/initializers/secret_token.rb',
+ 'config/initializers/session_store.rb',
+ 'config.ru'
+ ],
+ :build_command => 'bundle install --deployment --without development'
},
'omnibus-chef' => {
- :omnibus_path => "/opt/chef-server/embedded/cookbooks",
- :release_path => "files/chef-server-cookbooks"
+ :omnibus_path => '/opt/chef-server/embedded/cookbooks',
+ :release_path => 'files/chef-server-cookbooks'
},
'chef-pedant' => {
- :build_command => "bundle install"
+ :build_command => 'bundle install'
}
}
-[ DevHelper.code_root, DevHelper.backup_root].each do |dir|
+[DevHelper.code_root, DevHelper.backup_root].each do |dir|
directory dir do
- owner "root"
- group "root"
+ owner 'root'
+ group 'root'
recursive true
action :create
end
@@ -63,7 +67,7 @@
git ::File.join(DevHelper.code_root, project) do
repository "git://github.com/opscode/#{github_name}"
- reference "master"
+ reference 'master'
action :checkout
end
@@ -76,7 +80,7 @@
end
# Ensure the /opt/chef-server bin/ dirs is first in our PATH
-file "/etc/profile.d/omnibus-embedded.sh" do
+file '/etc/profile.d/omnibus-embedded.sh' do
content "export PATH=\"#{DevHelper.omnibus_path}:$PATH\""
action :create
end
View
4 spec/spec_helper.rb
@@ -0,0 +1,4 @@
+require 'chefspec'
+require 'chefspec/berkshelf'
+
+at_exit { ChefSpec::Coverage.report! }

0 comments on commit d41807a

Please sign in to comment.