Permalink
Browse files

updating examples and notes to reflect Chef 0.8

  • Loading branch information...
1 parent 32cab65 commit 709a15ec4269640b397975f6c1ecde1831ff5223 @jtimberman jtimberman committed Feb 28, 2010
Showing with 76 additions and 49 deletions.
  1. +1 −1 README
  2. +17 −19 Rakefile
  3. +6 −7 config/client.rb.example
  4. +10 −0 config/knife.rb.example
  5. +25 −16 config/server.rb.example
  6. +7 −3 config/solo.rb.example
  7. +3 −0 cookbooks/README
  8. +4 −1 roles/README
  9. +1 −1 roles/base_example.rb
  10. +2 −1 site-cookbooks/README
View
2 README
@@ -1,5 +1,5 @@
This is a blank repository you can use as a starting point for your
-local chef configuration. For full details on the parts aside from
+local chef configuration. For full details on the parts aside from
information contained in the README files, see the Chef wiki document
http://wiki.opscode.com/display/chef/Chef+Repository
View
@@ -8,9 +8,9 @@
# 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@ require 'json'
require File.join(File.dirname(__FILE__), 'config', 'rake')
# Detect the version control system and assign to $vcs. Used by the update
-# task in chef_repo.rake (below). The install task calls update, so this
+# task in chef_repo.rake (below). The install task calls update, so this
# is run whenever the repo is installed.
#
# Comment out these lines to skip the update.
@@ -45,24 +45,22 @@ load 'chef/tasks/chef_repo.rake'
desc "Bundle a single cookbook for distribution"
task :bundle_cookbook => [ :metadata ]
task :bundle_cookbook, :cookbook do |t, args|
- tarball_name = "#{args.cookbook}.tar.gz"
- temp_dir = File.join(Dir.tmpdir, "chef-upload-cookbooks")
- temp_cookbook_dir = File.join(temp_dir, args.cookbook)
- tarball_dir = File.join(TOPDIR, "pkgs")
- FileUtils.mkdir_p(tarball_dir)
- FileUtils.mkdir(temp_dir)
- FileUtils.mkdir(temp_cookbook_dir)
+ tarball_name = "#{args.cookbook}.tar.gz"
+ temp_dir = File.join(Dir.tmpdir, "chef-upload-cookbooks")
+ temp_cookbook_dir = File.join(temp_dir, args.cookbook)
+ tarball_dir = File.join(TOPDIR, "pkgs")
+ FileUtils.mkdir_p(tarball_dir)
+ FileUtils.mkdir(temp_dir)
+ FileUtils.mkdir(temp_cookbook_dir)
- child_folders = [ "cookbooks/#{args.cookbook}",
-"site-cookbooks/#{args.cookbook}" ]
- child_folders.each do |folder|
- file_path = File.join(TOPDIR, folder, ".")
- FileUtils.cp_r(file_path, temp_cookbook_dir) if File.directory?(file_path)
- end
+ child_folders = [ "cookbooks/#{args.cookbook}", "site-cookbooks/#{args.cookbook}" ]
+ child_folders.each do |folder|
+ file_path = File.join(TOPDIR, folder, ".")
+ FileUtils.cp_r(file_path, temp_cookbook_dir) if File.directory?(file_path)
+ end
- system("tar", "-C", temp_dir, "-cvzf", File.join(tarball_dir,
-tarball_name), "./#{args.cookbook}")
+ system("tar", "-C", temp_dir, "-cvzf", File.join(tarball_dir, tarball_name), "./#{args.cookbook}")
- FileUtils.rm_rf temp_dir
+ FileUtils.rm_rf temp_dir
end
View
@@ -7,16 +7,15 @@
log_level :info
log_location STDOUT
ssl_verify_mode :verify_none
-registration_url "https://chef.localdomain"
-openid_url "https://chef.localdomain"
-template_url "https://chef.localdomain"
-remotefile_url "https://chef.localdomain"
-search_url "https://chef.localdomain"
-role_url "https://chef.localdomain"
+chef_server_url "http://chef.example.com:4000"
+
+validation_client_name "chef-validator"
+validation_key "/etc/chef/validation.pem"
+client_key "/etc/chef/client.pem"
file_store_path "/srv/chef/file_store"
file_cache_path "/srv/chef/cache"
pid_file "/var/run/chef/chef-client.pid"
-Chef::Log::Formatter.show_time = true
+Mixlib::Log::Formatter.show_time = true
View
@@ -0,0 +1,10 @@
+log_level :info
+log_location STDOUT
+node_name 'chef_admin'
+client_key '/home/chef_admin/.chef/chef_admin.pem'
+validation_client_name 'chef-validator'
+validation_key '/home/chef_admin/.chef/chef-validator.pem'
+chef_server_url 'http://chef.example.com:4000'
+cache_type 'BasicFile'
+cache_options( :path => '/home/chef_admin/.chef/checksums' )
+cookbook_path [ './cookbooks', './site-cookbooks' ]
View
@@ -1,33 +1,42 @@
#
-# Example Chef Server Config File
+# Chef Server Config File
#
# We recommend using Opscode's chef cookbook for managing chef itself,
# instead of using this file. It is provided as an example.
log_level :info
-log_location "/var/log/chef/server.log"
+log_location STDOUT
ssl_verify_mode :verify_none
-registration_url "https://localhost"
-openid_url "https://localhost"
-template_url "https://localhost"
-remotefile_url "https://localhost"
-search_url "https://localhost"
-role_url "https://localhost"
+chef_server_url "http://chef.example.com:4000"
-#validation_token "change_this_token"
+signing_ca_path "/srv/chef/ca"
+couchdb_database 'chef'
-cookbook_path [ "/srv/chef/site-cookbooks", "/srv/chef/cookbooks" ]
+cookbook_path [ "/srv/chef/cookbooks", "/srv/chef/site-cookbooks" ]
-file_store_path "/srv/chef/file_store"
file_cache_path "/srv/chef/cache"
node_path "/srv/chef/nodes"
openid_store_path "/srv/chef/openid/store"
openid_cstore_path "/srv/chef/openid/cstore"
search_index_path "/srv/chef/search_index"
+role_path "/srv/chef/roles"
-# uncomment and modify to allow specific openid providers
-#openid_providers [ "https://localhost", "https://chef" ]
-# uncomment and modify to lock down openid identifiers, ie 'some_user.myopenid.com'
-#authorized_openid_identifiers [ "" ]
+validation_client_name "chef-validator"
+validation_key "/etc/chef/validation.pem"
+client_key "/etc/chef/client.pem"
+web_ui_client_name "chef-webui"
+web_ui_key "/etc/chef/webui.pem"
-Chef::Log::Formatter.show_time = true
+# change this as required.
+#web_ui_admin_user_name "admin"
+#web_ui_admin_default_password "replace_with_something_secure"
+
+supportdir = "/srv/chef/support"
+solr_jetty_path File.join(supportdir, "solr", "jetty")
+solr_data_path File.join(supportdir, "solr", "data")
+solr_home_path File.join(supportdir, "solr", "home")
+solr_heap_size "256M"
+
+umask 0022
+
+Mixlib::Log::Formatter.show_time = false
View
@@ -4,6 +4,10 @@
log_level :info
log_location STDOUT
-file_cache_path "/srv/chef/cookbooks"
-ssl_verify_mode :verify_none
-Chef::Log::Formatter.show_time = false
+file_cache_path "/var/chef/cookbooks"
+
+# Optionally store your JSON data file and a tarball of cookbooks remotely.
+#json_attribs "http://chef.example.com/dna.json"
+#recipe_url "http://chef.example.com/cookbooks.tar.gz"
+
+Mixlib::Log::Formatter.show_time = false
View
@@ -1 +1,4 @@
This directory contains upstream or shared cookbooks.
+
+To replace this with a Git repository, remove this directory and
+clone the upstream repository.
View
@@ -1 +1,4 @@
-Create roles here, in either .rb or .json files. Any roles created here win vs those created in the webui.
+Create roles here, in either .rb or .json files. To install roles on the
+server, use knife. We provide an example role here.
+
+knife role from file roles/base_example.rb
View
@@ -1,5 +1,5 @@
name "base_example"
-description "Base role applied to all nodes."
+description "Example base role applied to all nodes."
# List of recipes and roles to apply. Requires Chef 0.8, earlier versions use 'recipes()'.
#run_list()
View
@@ -1 +1,2 @@
-This directory contains cookbooks that modify upstream ones, or that are specific to your site.
+This directory contains cookbooks that modify upstream ones,
+or that are specific to your site.

0 comments on commit 709a15e

Please sign in to comment.