diff options
author | Adam Jacob <adam@hjksolutions.com> | 2008-10-08 21:40:02 -0700 |
---|---|---|
committer | Adam Jacob <adam@hjksolutions.com> | 2008-10-08 21:40:02 -0700 |
commit | 4dbefb3728643479f9e7f08c3d517c23b12bb29a (patch) | |
tree | 6a047d523b590f9a1be307898bac1f2073f4b6d1 | |
parent | 8655ef1cf2aa350c81b8edd0948dc3f55920034c (diff) | |
download | chef-4dbefb3728643479f9e7f08c3d517c23b12bb29a.tar.gz |
Adding example-repository
29 files changed, 592 insertions, 2 deletions
diff --git a/README.txt b/README.txt new file mode 100644 index 0000000000..2de55af5f3 --- /dev/null +++ b/README.txt @@ -0,0 +1,73 @@ += chef + +* http://oss.hjksolutions.com/chef + +== DESCRIPTION: + +Chef is a configuration management tool. + +I'm in ur netwerk, cookin up yer servers. :) + +== FEATURES/PROBLEMS: + + +== SYNOPSIS: + + +== REQUIREMENTS: + +RubyGems: + +* stomp +* stompserver +* ultraviolet +* facter +* ferret +* merb-core +* haml +* ruby-openid +* json + +External Servers: + +* stompserver (for easy stomp mq testing) +* CouchDB + +== INSTALL: + +Install all of the above. To fire up a develpment environment, do the following: + + * Start CouchDB with 'couchdb' + * Start stompserver with 'stompserver' + * Start chef-indexer with: + + chef-indexer -l debug + + * Start chef-server: + + chef-server -N -c 2 + + * Test run chef with: + + chef-client -l debug + +== LICENSE: + +Chef - A configuration management system + +Author:: Adam Jacob (<adam@hjksolutions.com>) +Copyright:: Copyright (c) 2008 HJK Solutions, LLC +License:: Apache License, Version 2.0 + +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. +See the License for the specific language governing permissions and +limitations under the License. + @@ -13,3 +13,13 @@ task :install do Dir.chdir(dir) { sh "rake install" } end end + +namespace :dev do + desc "Install a Devel instance of Chef with the example-repository" + task :install do + gems.each do |dir| + Dir.chdir(dir) { sh "rake install" } + end + Dir.chdir("example-repository") { sh("rake install") } + end +end
\ No newline at end of file diff --git a/chef-server/bin/chef-indexer b/chef-server/bin/chef-indexer index 4788aca0f7..02a02a8ad6 100755 --- a/chef-server/bin/chef-indexer +++ b/chef-server/bin/chef-indexer @@ -24,7 +24,7 @@ require 'rubygems' require 'facter' config = { - :config_file => "/etc/chef/config.rb", + :config_file => "/etc/chef/server.rb", :log_level => :info } opts = OptionParser.new do |opts| diff --git a/chef-server/lib/init.rb b/chef-server/lib/init.rb index 45dd4495a1..921afc4ff8 100644 --- a/chef-server/lib/init.rb +++ b/chef-server/lib/init.rb @@ -16,7 +16,7 @@ # limitations under the License. # -Merb.root = File.join(File.dirname(__FILE__)) +Merb.root = Chef::Config[:merb_root] # # ==== Structure of Merb initializer @@ -146,6 +146,7 @@ Merb::Config.use do |c| c[:exception_details] = true c[:reload_classes] = true c[:log_level] = :debug + c[:log_stream] = STDOUT end Merb.logger.info("Compiling routes...") diff --git a/chef-server/pkg/chef-server-0.0.1.gem b/chef-server/pkg/chef-server-0.0.1.gem Binary files differindex 86a59594cf..172cf53331 100644 --- a/chef-server/pkg/chef-server-0.0.1.gem +++ b/chef-server/pkg/chef-server-0.0.1.gem diff --git a/chef/lib/chef/config.rb b/chef/lib/chef/config.rb index 573cf9dfb7..cc1a780415 100644 --- a/chef/lib/chef/config.rb +++ b/chef/lib/chef/config.rb @@ -35,6 +35,7 @@ class Chef @configuration = { :cookbook_path => [ "/etc/chef/site-cookbook", "/etc/chef/cookbook" ], + :merb_root => "/var/chef/merb", :node_path => "/etc/chef/node", :file_store_path => "/var/chef/store", :search_index_path => "/var/chef/search_index", diff --git a/chef/pkg/chef-0.0.1.gem b/chef/pkg/chef-0.0.1.gem Binary files differindex c090729e12..97b08acd18 100644 --- a/chef/pkg/chef-0.0.1.gem +++ b/chef/pkg/chef-0.0.1.gem diff --git a/example-repository/Rakefile b/example-repository/Rakefile new file mode 100644 index 0000000000..0559eba641 --- /dev/null +++ b/example-repository/Rakefile @@ -0,0 +1,174 @@ +# +# Rakefile for Chef Server Repository +# +# Author:: Adam Jacob (<adam@hjksolutions.com>) +# Copyright:: Copyright (c) 2008 HJK Solutions, LLC +# License:: Apache License, Version 2.0 +# +# 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. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require File.join(File.dirname(__FILE__), 'config', 'rake') + +require 'tempfile' + +$vcs = :svn +if File.directory?(File.join(TOPDIR, ".svn")) + $vcs = :svn +elsif File.directory?(File.join(TOPDIR, ".git")) + $vcs = :git +end + +desc "Update your repository from source control" +task :update do + puts "** Updating your repository" + + case $vcs + when :svn + sh %{svn up} + when :git + pull = false + pull = true if File.join(TOPDIR, ".git", "remotes", "origin") + IO.foreach(File.join(TOPDIR, ".git", "config")) do |line| + pull = true if line =~ /\[remote "origin"\]/ + end + if pull + sh %{git pull} + else + puts "* Skipping git pull, no origin specified" + end + end +end + +desc "Test your cookbooks for syntax errors" +task :test do + puts "** Testing your cookbooks for syntax errors" + Dir[ File.join(TOPDIR, "cookbooks", "**", "*.rb") ].each do |recipe| + sh %{ruby -c #{recipe}} do |ok, res| + if ! ok + raise "Syntax error in #{recipe}" + end + end + end +end + +desc "Install the latest copy of the repository on this Chef Server" +task :install => [ :update, :test ] do + puts "** Installing your cookbooks" + directories = [ + COOKBOOK_PATH, + SITE_COOKBOOK_PATH, + CHEF_CONFIG_PATH + ] + puts "* Creating Directories" + directories.each do |dir| + sh "sudo mkdir -p #{dir}" + sh "sudo chown root #{dir}" + end + puts "* Installing new Cookbooks" + sh "sudo rsync -rlP --delete --exclude '.svn' cookbooks/ #{COOKBOOK_PATH}" + puts "* Installing new Site Cookbooks" + sh "sudo rsync -rlP --delete --exclude '.svn' cookbooks/ #{COOKBOOK_PATH}" + puts "* Installing new Chef Server Config" + sh "sudo cp config/server.rb #{CHEF_SERVER_CONFIG}" + puts "* Installing new Chef Client Config" + sh "sudo cp config/client.rb #{CHEF_CLIENT_CONFIG}" +end + +desc "By default, run rake test" +task :default => [ :test ] + +desc "Create a new cookbook (with COOKBOOK=name)" +task :new_cookbook do + create_cookbook(File.join(TOPDIR, "cookbooks")) +end + +def create_cookbook(dir) + raise "Must provide a COOKBOOK=" unless ENV["COOKBOOK"] + puts "** Creating cookbook #{ENV["COOKBOOK"]}" + sh "mkdir -p #{File.join(dir, ENV["COOKBOOK"], "attributes")}" + sh "mkdir -p #{File.join(dir, ENV["COOKBOOK"], "recipes")}" + sh "mkdir -p #{File.join(dir, ENV["COOKBOOK"], "definitions")}" + sh "mkdir -p #{File.join(dir, ENV["COOKBOOK"], "libraries")}" + sh "mkdir -p #{File.join(dir, ENV["COOKBOOK"], "files", "default")}" + sh "mkdir -p #{File.join(dir, ENV["COOKBOOK"], "templates", "default")}" + unless File.exists?(File.join(dir, ENV["COOKBOOK"], "recipes", "default.rb")) + open(File.join(dir, ENV["COOKBOOK"], "recipes", "default.rb"), "w") do |file| + file.puts <<-EOH +# +# Cookbook Name:: #{ENV["COOKBOOK"]} +# Recipe:: default +# +# Copyright #{Time.now.year}, #{COMPANY_NAME} +# +EOH + case NEW_COOKBOOK_LICENSE + when :apachev2 + file.puts <<-EOH +# 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. +# See the License for the specific language governing permissions and +# limitations under the License. +# +EOH + when :none + file.puts <<-EOH +# All rights reserved - Do Not Redistribute +# +EOH + end + end + end +end + +desc "Create a new self-signed SSL certificate for FQDN=foo.example.com" +task :ssl_cert do + $expect_verbose = true + fqdn = ENV["FQDN"] + fqdn =~ /^(.+?)\.(.+)$/ + hostname = $1 + domain = $2 + raise "Must provide FQDN!" unless fqdn && hostname && domain + puts "** Creating self signed SSL Certificate for #{fqdn}" + sh("(cd #{CADIR} && openssl genrsa 2048 > #{fqdn}.key)") + sh("(cd #{CADIR} && chmod 644 #{fqdn}.key)") + puts "* Generating Self Signed Certificate Request" + tf = Tempfile.new("#{fqdn}.ssl-conf") + ssl_config = <<EOH +[ req ] +distinguished_name = req_distinguished_name +prompt = no + +[ req_distinguished_name ] +C = #{SSL_COUNTRY_NAME} +ST = #{SSL_STATE_NAME} +L = #{SSL_LOCALITY_NAME} +O = #{COMPANY_NAME} +OU = #{SSL_ORGANIZATIONAL_UNIT_NAME} +CN = #{fqdn} +emailAddress = #{SSL_EMAIL_ADDRESS} +EOH + tf.puts(ssl_config) + tf.close + sh("(cd #{CADIR} && openssl req -config '#{tf.path}' -new -x509 -nodes -sha1 -days 3650 -key #{fqdn}.key > #{fqdn}.crt)") + sh("(cd #{CADIR} && openssl x509 -noout -fingerprint -text < #{fqdn}.crt > #{fqdn}.info)") + sh("(cd #{CADIR} && cat #{fqdn}.crt #{fqdn}.key > #{fqdn}.pem)") + sh("(cd #{CADIR} && chmod 644 #{fqdn}.pem)") +end
\ No newline at end of file diff --git a/example-repository/config/client.rb b/example-repository/config/client.rb new file mode 100644 index 0000000000..3a6b5fde4a --- /dev/null +++ b/example-repository/config/client.rb @@ -0,0 +1,21 @@ +# +# Cookbook Name:: chef +# Attribute File:: client.rb +# +# Copyright 2008, Engine Yard, Inc. +# +# All rights reserved - Do Not Redistribute +# + +log_level :info +log_location STDOUT +file_store_path "/var/chef/file_store" +file_cache_path "/var/chef/cache" +ssl_verify_mode :verify_none +registration_url "http://127.0.0.1:4000" +openid_url "http://127.0.0.1:4001" +template_url "http://127.0.0.1:4000" +remotefile_url "http://127.0.0.1:4000" +search_url "http://127.0.0.1:4000" + + diff --git a/example-repository/config/rake.rb b/example-repository/config/rake.rb new file mode 100644 index 0000000000..3272a67b03 --- /dev/null +++ b/example-repository/config/rake.rb @@ -0,0 +1,54 @@ +### +# Company and SSL Details +### + +# The company name - used for SSL certificates, and in various other places +COMPANY_NAME = "Example Com" + +# The Country Name to use for SSL Certificates +SSL_COUNTRY_NAME = "US" + +# The State Name to use for SSL Certificates +SSL_STATE_NAME = "Washington" + +# The Locality Name for SSL - typically, the city +SSL_LOCALITY_NAME = "Seattle" + +# What department? +SSL_ORGANIZATIONAL_UNIT_NAME = "Operations" + +# The SSL contact email address +SSL_EMAIL_ADDRESS = "ops@example.com" + +# License for new Cookbooks +# Can be :apachev2 or :none +NEW_COOKBOOK_LICENSE = :apachev2 + +########################## +# Chef Repository Layout # +########################## + +# Where to find upstream cookbooks +COOKBOOK_PATH = "/var/chef/cookbooks" + +# Where to find site-local modifications to upstream cookbooks +SITE_COOKBOOK_PATH = "/var/chef/site-cookbooks" + +# Chef Config Path +CHEF_CONFIG_PATH = "/etc/chef" + +# The location of the Chef Server Config file (on the server) +CHEF_SERVER_CONFIG = File.join(CHEF_CONFIG_PATH, "server.rb") + +# The location of the Chef Client Config file (on the client) +CHEF_CLIENT_CONFIG = File.join(CHEF_CONFIG_PATH, "client.rb") + +### +# Useful Extras (which you probably don't need to change) +### + +# The top of the repository checkout +TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), "..")) + +# Where to store certificates generated with ssl_cert +CADIR = File.expand_path(File.join(TOPDIR, "certificates")) diff --git a/example-repository/config/server.rb b/example-repository/config/server.rb new file mode 100644 index 0000000000..f5557daa4a --- /dev/null +++ b/example-repository/config/server.rb @@ -0,0 +1,25 @@ +# +# Chef Server Config File +# +# Dynamically generated by Chef - local modifications will be replaced +# + + +log_level :info +log_location STDOUT +file_store_path "/var/chef/file_store" +file_cache_path "/var/chef/cache" +ssl_verify_mode :verify_none +registration_url "http://127.0.0.1:4000" +openid_url "http://127.0.0.1:4001" +template_url "http://127.0.0.1:4000" +remotefile_url "http://127.0.0.1:4000" +search_url "http://127.0.0.1:4000" +cookbook_path [ "/var/chef/site-cookbooks", "/var/chef/cookbooks" ] +node_path "/var/chef/nodes" +openid_store_path "/var/chef/openid/store" +openid_cstore_path "/var/chef/openid/cstore" +merb_log_path "/var/log/chef-server.log" +search_index_path "/var/chef/search_index" + +Chef::Log::Formatter.show_time = false diff --git a/example-repository/cookbooks/fakefile/attributes/first.rb b/example-repository/cookbooks/fakefile/attributes/first.rb new file mode 100644 index 0000000000..927dafe967 --- /dev/null +++ b/example-repository/cookbooks/fakefile/attributes/first.rb @@ -0,0 +1,2 @@ +Chef::Log.debug("You are the first of fakefile's attributes") +friends("you said we wuz visiting em")
\ No newline at end of file diff --git a/example-repository/cookbooks/fakefile/definitions/test.rb b/example-repository/cookbooks/fakefile/definitions/test.rb new file mode 100644 index 0000000000..ce32293943 --- /dev/null +++ b/example-repository/cookbooks/fakefile/definitions/test.rb @@ -0,0 +1,13 @@ +define :monkey, :eats => "bananna" do + file "/tmp/monkeynews-#{params[:name]}" do + owner "root" + mode 0644 + action :create + end + + file "/tmp/monkeynews-#{params[:name]}-second-#{params[:eats]}" do + owner "root" + mode 0644 + notifies :touch, resources(:file => "/tmp/monkeynews-#{params[:name]}"), :immediately + end +end
\ No newline at end of file diff --git a/example-repository/cookbooks/fakefile/files/default/remote_test/another/turn/the_page.txt b/example-repository/cookbooks/fakefile/files/default/remote_test/another/turn/the_page.txt new file mode 100644 index 0000000000..9664cb3e15 --- /dev/null +++ b/example-repository/cookbooks/fakefile/files/default/remote_test/another/turn/the_page.txt @@ -0,0 +1 @@ +Classic rock is awesome. diff --git a/example-repository/cookbooks/fakefile/files/default/remote_test/another/window.txt b/example-repository/cookbooks/fakefile/files/default/remote_test/another/window.txt new file mode 100644 index 0000000000..68a3bf17e4 --- /dev/null +++ b/example-repository/cookbooks/fakefile/files/default/remote_test/another/window.txt @@ -0,0 +1 @@ +appleseed?
\ No newline at end of file diff --git a/example-repository/cookbooks/fakefile/files/default/remote_test/mycat.txt b/example-repository/cookbooks/fakefile/files/default/remote_test/mycat.txt new file mode 100644 index 0000000000..d4d8511934 --- /dev/null +++ b/example-repository/cookbooks/fakefile/files/default/remote_test/mycat.txt @@ -0,0 +1 @@ +is a very nice kitty
\ No newline at end of file diff --git a/example-repository/cookbooks/fakefile/files/default/the_park.txt b/example-repository/cookbooks/fakefile/files/default/the_park.txt new file mode 100644 index 0000000000..c71308a6ca --- /dev/null +++ b/example-repository/cookbooks/fakefile/files/default/the_park.txt @@ -0,0 +1,3 @@ +Is very pretty on a Saturday at 7:50 in August. Hottest day of the year so far in Seattle. + +something
\ No newline at end of file diff --git a/example-repository/cookbooks/fakefile/libraries/test.rb b/example-repository/cookbooks/fakefile/libraries/test.rb new file mode 100644 index 0000000000..5a39a18aec --- /dev/null +++ b/example-repository/cookbooks/fakefile/libraries/test.rb @@ -0,0 +1,7 @@ +class Chef + class Recipe + def bork + Chef::Log.debug("Bork bork bork") + end + end +end
\ No newline at end of file diff --git a/example-repository/cookbooks/fakefile/recipes/default.rb b/example-repository/cookbooks/fakefile/recipes/default.rb new file mode 100644 index 0000000000..709e51b6e3 --- /dev/null +++ b/example-repository/cookbooks/fakefile/recipes/default.rb @@ -0,0 +1,152 @@ +bork + +execute "write-foolio" do + command <<-EOH + echo 'monkeypants #{node[:ipaddress]} #{node[:friends]}' > /tmp/foolio + EOH + user "daemon" +end + +script "monkeylikesit" do + code %q{ +print "Woot!\n"; +open(FILE, ">", "/tmp/monkeylikesit") or die "Cannot open monkeylikesit"; +print FILE "You have some interesting hobbies #{node[:ipaddress]}"; +close(FILE); +} + interpreter "perl" +end + +perl "foobar" do + code %q{ +print "Woot!\n"; + } +end + +unless @node[:operatingsystem] == "Darwin" + package "emacs" + + package "emacs" do + action :remove + end + + package "emacs" do + version "22.1-0ubuntu10" + action :install + end + + package "emacs" do + action :upgrade + end + + package "emacs" do + action :purge + end +end + +package "ruby-djbdns" do + action [ :install, :remove, :upgrade, :purge ] + provider Chef::Provider::Package::Rubygems +end + +gem_package "ruby-djbdns" do + action [ :install, :remove, :upgrade, :purge ] +end + +file "/tmp/foo" do + owner "adam" + mode 0644 + action :create + notifies :delete, resources(:file => "/tmp/glen"), :delayed +end + +remote_file "/tmp/the_park.txt" do + owner "adam" + mode 0644 + source "the_park.txt" + action :create +end + +remote_directory "/tmp/remote_test" do + owner "adam" + mode 0755 + source "remote_test" + files_owner "root" + files_group(node[:operatingsystem] == "Debian" ? "root" : "wheel") + files_mode 0644 + files_backup false +end + +template "/tmp/foo-template" do + owner "adam" + mode 0644 + source "monkey.erb" + variables({ + :one => 'two', + :el_che => 'rhymefest', + :white => { + :stripes => "are the best", + :at => "the sleazy rock thing", + } + }) +end + +link "/tmp/foo" do + link_type :symbolic + target_file "/tmp/xmen" +end + +# 0.upto(1000) do |n| +# file "/tmp/somefile#{n}" do +# owner "adam" +# mode 0644 +# action :create +# end +# end + +directory "/tmp/home" do + owner "root" + mode 0755 + action :create +end + +search(:user, "*") do |u| + directory "/tmp/home/#{u['name']}" do + if u['name'] == "nobody" && @node[:operatingsystem] == "Darwin" + owner "root" + else + owner "#{u['name']}" + end + mode 0755 + action :create + end +end + +monkey "snoopy" do + eats "vegetables" +end + +monkey "snack" + +# user "katie" do +# uid 9999 +# gid 100 +# home "/tmp/home/katie" +# shell "/bin/bash" +# comment "Katie Bethell" +# action :create +# end +# +# user "katie" do +# gid 101 +# action :modify +# end +# +# user "katie" do +# shell "/home/katie" +# action :manage +# end +# +# user "katie" do +# action [ :lock, :unlock, :remove ] +# end diff --git a/example-repository/cookbooks/fakefile/templates/default/monkey.erb b/example-repository/cookbooks/fakefile/templates/default/monkey.erb new file mode 100644 index 0000000000..29c2639381 --- /dev/null +++ b/example-repository/cookbooks/fakefile/templates/default/monkey.erb @@ -0,0 +1,5 @@ +This is a <%= @one %> with <%= @el_che %> + +It was rendered on a system with the ipaddress of <%= @node[:ipaddress] %> + +But it's all about the conquest, with <%= @node[:fqdn ] %> diff --git a/example-repository/cookbooks/rubygems_server/attributes/first.rb b/example-repository/cookbooks/rubygems_server/attributes/first.rb new file mode 100644 index 0000000000..d1b7bd6a23 --- /dev/null +++ b/example-repository/cookbooks/rubygems_server/attributes/first.rb @@ -0,0 +1 @@ +rubygems("are awesome") diff --git a/example-repository/cookbooks/rubygems_server/files/default/packages/net-scp-1.0.1.gem b/example-repository/cookbooks/rubygems_server/files/default/packages/net-scp-1.0.1.gem Binary files differnew file mode 100644 index 0000000000..d3eafbca10 --- /dev/null +++ b/example-repository/cookbooks/rubygems_server/files/default/packages/net-scp-1.0.1.gem diff --git a/example-repository/cookbooks/rubygems_server/files/default/packages/net-sftp-2.0.1.gem b/example-repository/cookbooks/rubygems_server/files/default/packages/net-sftp-2.0.1.gem Binary files differnew file mode 100644 index 0000000000..e9bc3c2276 --- /dev/null +++ b/example-repository/cookbooks/rubygems_server/files/default/packages/net-sftp-2.0.1.gem diff --git a/example-repository/cookbooks/rubygems_server/files/default/packages/net-ssh-2.0.3.gem b/example-repository/cookbooks/rubygems_server/files/default/packages/net-ssh-2.0.3.gem Binary files differnew file mode 100644 index 0000000000..b11cbe00cc --- /dev/null +++ b/example-repository/cookbooks/rubygems_server/files/default/packages/net-ssh-2.0.3.gem diff --git a/example-repository/cookbooks/rubygems_server/files/default/packages/net-ssh-gateway-1.0.0.gem b/example-repository/cookbooks/rubygems_server/files/default/packages/net-ssh-gateway-1.0.0.gem Binary files differnew file mode 100644 index 0000000000..545f850a71 --- /dev/null +++ b/example-repository/cookbooks/rubygems_server/files/default/packages/net-ssh-gateway-1.0.0.gem diff --git a/example-repository/cookbooks/rubygems_server/recipes/default.rb b/example-repository/cookbooks/rubygems_server/recipes/default.rb new file mode 100644 index 0000000000..6b60456094 --- /dev/null +++ b/example-repository/cookbooks/rubygems_server/recipes/default.rb @@ -0,0 +1,8 @@ +remote_directory "/srv/gems" do + owner "www-data" + mode 0755 + source "packages" + files_owner "www-data" + files_group "www-data" + files_mode 0644 +end diff --git a/example-repository/cookbooks/servicetest/recipes/default.rb b/example-repository/cookbooks/servicetest/recipes/default.rb new file mode 100644 index 0000000000..812b48e19d --- /dev/null +++ b/example-repository/cookbooks/servicetest/recipes/default.rb @@ -0,0 +1,12 @@ +service "puppet-client" do + service_name "puppet" + pattern "puppetd" + action :enable +end + +file "/tmp/foo" do + owner "aj" + mode 0644 + action :create + notifies :start, resources(:service => "puppet-client"), :immediate +end diff --git a/example-repository/cookbooks/tempfile/attributes/second.rb b/example-repository/cookbooks/tempfile/attributes/second.rb new file mode 100644 index 0000000000..df791b8429 --- /dev/null +++ b/example-repository/cookbooks/tempfile/attributes/second.rb @@ -0,0 +1 @@ +monkey "poots"
\ No newline at end of file diff --git a/example-repository/cookbooks/tempfile/recipes/default.rb b/example-repository/cookbooks/tempfile/recipes/default.rb new file mode 100644 index 0000000000..b4fa86ac32 --- /dev/null +++ b/example-repository/cookbooks/tempfile/recipes/default.rb @@ -0,0 +1,24 @@ +file "/tmp/glen" do + owner "adam" + mode 0755 + action "create" +end + +file "/tmp/metallica" do + action [ :create, :touch, :delete ] +end + +directory "/tmp/marginal" do + owner "adam" + mode 0755 + action :create +end + +remote_directory "/tmp/rubygems" do + owner "adam" + mode 0755 + source "packages" + files_owner "adam" + files_group "adam" + files_mode 0755 +end |