diff --git a/README.md b/README.md index 208d803..bfbce5e 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,9 @@ Getting Started Assuming root access on a fresh, basic, CentOS 5.6 install: + +!! setenforce 0 + 1. Install the EPEL repositories for git rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm @@ -53,9 +56,9 @@ Assuming root access on a fresh, basic, CentOS 5.6 install: This should install all the dependencies to build ruby -3. Chose a ruby version and install, 1.9.2-p180 is the default for the bootstrap. +3. Chose a ruby version and install, 1.9.2-p290 is the default for the bootstrap. - rvm install 1.9.2-p180 + rvm install 1.9.2-p290 > By default rvm will connect to the internet to download the ruby packages > to compile. If this is a problem you should install your own copy of rvm @@ -64,7 +67,7 @@ Assuming root access on a fresh, basic, CentOS 5.6 install: 4. Next we use rvm to create an isolated gemset for Chef and install it - rvm 1.9.2-p180@chef gem install chef -v 0.9.16 + rvm 1.9.2-p290@chef gem install chef -v 0.10.2 5. Now we can move on to the actual Chef install. First we need a temporary config for chef-solo to extract and execute our bootstrap cookbooks: @@ -99,20 +102,20 @@ Assuming root access on a fresh, basic, CentOS 5.6 install: or, by picking the right url to make chef-solo happy (open-uri doesn't like the github redirect), reference them directly via - http://cloud.github.com/downloads/mdkent/chef-el-rvm-bootstrap/chef-el-rvm-bootstrap-0.9.16-1.tar.gz + http://cloud.github.com/downloads/mdkent/chef-el-rvm-bootstrap/chef-el-rvm-bootstrap-0.10.2-1.tar.gz 8. We are all set to run the Chef bootstrap. chef-solo can be invoked with local files: - rvm 1.9.2-p180@chef exec chef-solo -c solo.rb \ + rvm 1.9.2-p290@chef exec chef-solo -c solo.rb \ -j chef-server-api-webui.json \ - -r chef-el-rvm-bootstrap-0.9.16-1.tar.gz + -r chef-el-rvm-bootstrap-0.10.2-1.tar.gz or looking at remote urls: - rvm 1.9.2-p180@chef exec chef-solo -c solo.rb \ + rvm 1.9.2-p290@chef exec chef-solo -c solo.rb \ -j https://github.com/mdkent/chef-el-rvm-bootstrap/raw/master/chef-server-api-webui.json \ - -r http://cloud.github.com/downloads/mdkent/chef-el-rvm-bootstrap/chef-el-rvm-bootstrap-0.9.16-1.tar.gz + -r http://cloud.github.com/downloads/mdkent/chef-el-rvm-bootstrap/chef-el-rvm-bootstrap-0.10.2-1.tar.gz Assuming chef-solo completes without incident you should now have a fully configured and functioning chef server or client. diff --git a/Rakefile b/Rakefile index 1c18c87..267f529 100644 --- a/Rakefile +++ b/Rakefile @@ -2,7 +2,7 @@ require 'rake/packagetask' require 'find' PACKAGE_NAME = "chef-el-rvm-bootstrap" -PACKAGE_VERSION="0.9.16-1" +PACKAGE_VERSION="0.10.2-1" PACKAGE_FULL="#{PACKAGE_NAME}-#{PACKAGE_VERSION}" PACKAGE_DIR = "tmp" INCLUDE_FILES = "**/*" diff --git a/apache2/definitions/web_app.rb b/apache2/definitions/web_app.rb index 3531fd8..e73def9 100644 --- a/apache2/definitions/web_app.rb +++ b/apache2/definitions/web_app.rb @@ -20,7 +20,7 @@ # define :web_app, :template => "web_app.conf.erb" do - + application_name = params[:name] include_recipe "apache2" diff --git a/chef-client.json b/chef-client.json index 8fdfba8..2b2f5f6 100644 --- a/chef-client.json +++ b/chef-client.json @@ -1,7 +1,7 @@ { - "chef_rvm": { + "chef_client": { "server_url": "http://localhost:4000", - "rvm_ruby": "1.9.2-p180@chef" + "rvm_ruby": "1.9.2-p290@chef" }, - "run_list": [ "recipe[chef_rvm::client]" ] + "run_list": [ "recipe[chef-client::config]", "recipe[chef-client::service]" ] } diff --git a/chef-server-api-webui-proxy.json b/chef-server-api-webui-proxy.json index 1d4bdd3..d1c26a3 100644 --- a/chef-server-api-webui-proxy.json +++ b/chef-server-api-webui-proxy.json @@ -1,8 +1,8 @@ { - "chef_rvm": { + "chef_server": { "server_url": "http://localhost:4000", "webui_enabled": true, - "rvm_ruby": "1.9.2-p180@chef" + "rvm_ruby": "1.9.2-p290@chef" }, - "run_list": [ "recipe[chef_rvm::server_proxy]" ] + "run_list": [ "recipe[chef-server::rubygems-install]", "recipe[chef-server::apache-proxy]" ] } diff --git a/chef-server-api-webui.json b/chef-server-api-webui.json index 9e9b2c9..6036c3f 100644 --- a/chef-server-api-webui.json +++ b/chef-server-api-webui.json @@ -1,8 +1,8 @@ { - "chef_rvm": { + "chef_server": { "server_url": "http://localhost:4000", "webui_enabled": true, - "rvm_ruby": "1.9.2-p180@chef" + "rvm_ruby": "1.9.2-p290@chef" }, - "run_list": [ "recipe[chef_rvm::server]" ] + "run_list": [ "recipe[chef-server::rubygems-install]" ] } diff --git a/chef-server-api.json b/chef-server-api.json index 364e472..ceb6f58 100644 --- a/chef-server-api.json +++ b/chef-server-api.json @@ -1,7 +1,7 @@ { - "chef_rvm": { + "chef_server": { "server_url": "http://localhost:4000", - "rvm_ruby": "1.9.2-p180@chef" + "rvm_ruby": "1.9.2-p290@chef" }, - "run_list": [ "recipe[chef_rvm::server]" ] + "run_list": [ "recipe[chef-server::rubygems-install]" ] } diff --git a/chef_rvm/attributes/default.rb b/chef_rvm/attributes/default.rb deleted file mode 100644 index ff43d18..0000000 --- a/chef_rvm/attributes/default.rb +++ /dev/null @@ -1,45 +0,0 @@ -# -# Modified By:: Matthew Kent -# Original Author:: Joshua Timberman -# Cookbook Name:: chef_rvm -# Attributes:: default -# -# Copyright 2008-2010, Opscode, Inc -# -# 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. - -default[:chef_rvm][:umask] = "0022" -default[:chef_rvm][:url_type] = "http" - -default[:chef_rvm][:path] = "/var/lib/chef" -default[:chef_rvm][:serve_path] = "/var/lib/chef" -default[:chef_rvm][:run_path] = "/var/run/chef" -default[:chef_rvm][:cache_path] = "/var/cache/chef" -default[:chef_rvm][:backup_path] = "/var/lib/chef/backup" - -default[:chef_rvm][:server_version] = node.chef_packages.chef[:version] -default[:chef_rvm][:client_version] = node.chef_packages.chef[:version] -default[:chef_rvm][:client_interval] = "1800" -default[:chef_rvm][:client_splay] = "20" -default[:chef_rvm][:log_dir] = "/var/log/chef" -default[:chef_rvm][:server_port] = "4000" -default[:chef_rvm][:webui_port] = "4040" -default[:chef_rvm][:webui_enabled] = false -default[:chef_rvm][:solr_heap_size] = "256M" -default[:chef_rvm][:validation_client_name] = "chef-validator" - -default[:chef_rvm][:server_fqdn] = node.has_key?(:domain) ? "chef.#{domain}" : "chef" -default[:chef_rvm][:server_url] = "#{node.chef_rvm.url_type}://#{node.chef_rvm.server_fqdn}:#{node.chef_rvm.server_port}" - -default[:chef_rvm][:rvm_ruby] = "1.9.2-p180@chef" -default[:chef_rvm][:rvm_binary] = "/usr/bin/rvm" diff --git a/chef_rvm/attributes/server_proxy.rb b/chef_rvm/attributes/server_proxy.rb deleted file mode 100644 index 4c5e396..0000000 --- a/chef_rvm/attributes/server_proxy.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# Modified By:: Matthew Kent -# Original Author:: David Abdemoulaie -# Cookbook Name:: chef_rvm -# Attributes:: server_proxy -# -# Copyright 2009, David Abdemoulaie -# -# 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. - -include_attribute "apache2" -include_attribute "chef_rvm" - -default[:chef_rvm][:doc_root] = "#{languages[:ruby][:gems_dir]}/gems/chef-server-webui-#{chef_rvm[:server_version]}/public" - -default[:chef_rvm][:server_ssl_req] = "/C=US/ST=Several/L=Locality/O=Example/OU=Operations/" + - "CN=#{node.chef_rvm.server_fqdn}/emailAddress=ops@#{node.chef_rvm.server_fqdn}" - -default[:chef_rvm][:server_proxy][:css_expire_hours] = "120" -default[:chef_rvm][:server_proxy][:js_expire_hours] = "24" diff --git a/chef_rvm/metadata.rb b/chef_rvm/metadata.rb deleted file mode 100644 index 13a8b12..0000000 --- a/chef_rvm/metadata.rb +++ /dev/null @@ -1,20 +0,0 @@ -maintainer "Matthew Kent" -maintainer_email "mkent@magoazul.com" -license "Apache 2.0" -description "Installs and configures Chef for chef-client and chef-server" -version "0.1" - -recipe "chef_rvm", "Default recipe is empty, use one of the other recipes." -recipe "chef_rvm::client", "Sets up a client to talk to a chef-server" -recipe "chef_rvm::client_service", "Sets up a client daemon to run periodically" -recipe "chef_rvm::delete_validation", "Deletes validation.pem after client registers" -recipe "chef_rvm::server", "Configures a chef API server as a merb application" -recipe "chef_rvm::server_proxy", "Configures Apache2 proxy for API and WebUI" - -%w{ couchdb rabbitmq_chef apache2 openssl zlib xml java }.each do |cb| - depends cb -end - -%w{ centos redhat }.each do |os| - supports os -end diff --git a/chef_rvm/recipes/client.rb b/chef_rvm/recipes/client.rb deleted file mode 100644 index 291a970..0000000 --- a/chef_rvm/recipes/client.rb +++ /dev/null @@ -1,117 +0,0 @@ -# -# Modified By:: Matthew Kent -# Original Author:: Joshua Timberman -# Original Author:: Joshua Sierles -# Cookbook Name:: chef_rvm -# Recipe:: client -# -# Copyright 2008-2010, Opscode, Inc -# Copyright 2009, 37signals -# -# 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. - -recipe_name = self.recipe_name -cookbook_name = self.cookbook_name - -gem_package "chef" do - version node[:chef_rvm][:client_version] -end - -user "chef" do - system true - shell "/sbin/nologin" - home node[:chef_rvm][:path] -end - -chef_dirs = [ - "/etc/chef", - node[:chef_rvm][:path], - node[:chef_rvm][:serve_path], - node[:chef_rvm][:run_path], - node[:chef_rvm][:cache_path], - node[:chef_rvm][:backup_path], - node[:chef_rvm][:log_dir] -].uniq - -chef_dirs.each do |dir| - directory dir do - recursive true - owner "chef" - group "root" - mode 0755 - end -end - -ruby_block "reload_client_config" do - block do - Chef::Config.from_file("/etc/chef/client.rb") - end - action :nothing -end - -%w{client solo}.each do |cfg| - template "/etc/chef/#{cfg}.rb" do - source "#{cfg}.rb.erb" - owner "root" - group "root" - mode 0644 - notifies :create, resources(:ruby_block => "reload_client_config") - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name - ) - end -end - -%w{chef-client chef-solo knife ohai shef}.each do |bin| - template "/usr/bin/#{bin}" do - source "rvm_wrapper.bin.erb" - owner "root" - group "root" - mode 0755 - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name, - :binary => bin - ) - end -end - -template "/etc/init.d/chef-client" do - source "chef-client.init.erb" - owner "root" - group "root" - mode 0755 - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name - ) -end - -template "/etc/logrotate.d/chef-client" do - source "chef-client.logrotate.erb" - owner "root" - group "root" - mode 0644 - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name - ) -end - -log "Add the chef_rvm::delete_validation recipe to the run list to remove the #{Chef::Config[:validation_key]}." do - only_if { ::File.exists?(Chef::Config[:validation_key]) } -end - -# required for user password management -include_recipe "ruby-shadow::source" diff --git a/chef_rvm/recipes/client_service.rb b/chef_rvm/recipes/client_service.rb deleted file mode 100644 index ae04fba..0000000 --- a/chef_rvm/recipes/client_service.rb +++ /dev/null @@ -1,25 +0,0 @@ -# -# Modified By:: Matthew Kent -# Original Author:: Joshua Timberman -# Cookbook Name:: chef_rvm -# Recipe:: bootstrap_client -# -# Copyright 2009-2010, Opscode, Inc. -# -# 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. - -service "chef-client" do - action [ :enable, :start ] -end - -include_recipe "chef_rvm::client" diff --git a/chef_rvm/recipes/default.rb b/chef_rvm/recipes/default.rb deleted file mode 100644 index e69de29..0000000 diff --git a/chef_rvm/recipes/delete_validation.rb b/chef_rvm/recipes/delete_validation.rb deleted file mode 100644 index aa5fd58..0000000 --- a/chef_rvm/recipes/delete_validation.rb +++ /dev/null @@ -1,25 +0,0 @@ -# -# Modified By:: Matthew Kent -# Original Author:: Joshua Timberman -# Cookbook Name:: chef_rvm -# Recipe:: delete_validation -# -# Copyright 2010, Opscode, Inc -# -# 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. - -file Chef::Config[:validation_key] do - action :delete - backup false - only_if { ::File.exists?(Chef::Config[:client_key]) } -end diff --git a/chef_rvm/recipes/server.rb b/chef_rvm/recipes/server.rb deleted file mode 100644 index 44523ed..0000000 --- a/chef_rvm/recipes/server.rb +++ /dev/null @@ -1,155 +0,0 @@ -# -# Modified By:: Matthew Kent -# Original Author:: Joshua Timberman -# Original Author:: Joshua Sierles -# Cookbook Name:: chef_rvm -# Recipe:: server -# -# Copyright 2008-2009, Opscode, Inc -# Copyright 2009, 37signals -# -# 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. - -recipe_name = self.recipe_name -cookbook_name = self.cookbook_name - -include_recipe "chef_rvm::client" - -include_recipe "java" -include_recipe "couchdb" -include_recipe "rabbitmq_chef" -include_recipe "zlib" -include_recipe "xml" - -server_gems = %w{ chef-server-api chef-solr } -server_services = { - "chef-server" => "server", - "chef-solr" => "solr", - "chef-solr-indexer" => "solr-indexer" -} - -if node.chef_rvm.attribute?("webui_enabled") - server_gems << "chef-server-webui" - server_services["chef-server-webui"] = "webui" -end - -server_gems.each do |gem| - gem_package gem do - version node.chef_rvm.server_version - end -end - -directory "/etc/chef/certificates" do - owner "chef" - group "root" - mode 0700 -end - -server_services.each do |svc, cfg| - service "#{svc}" do - action :nothing - end - - template "/etc/chef/#{cfg}.rb" do - source "#{cfg}.rb.erb" - owner "chef" - group "root" - mode 0600 - notifies :restart, resources( :service => svc), :delayed - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name - ) - end - - template "/usr/bin/#{svc}" do - source "rvm_wrapper.bin.erb" - owner "root" - group "root" - mode 0755 - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name, - :binary => svc - ) - end - - template"/etc/init.d/#{svc}" do - source "#{svc}.init.erb" - owner "root" - group "root" - mode 0755 - notifies :restart, resources( :service => svc), :delayed - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name - ) - end - - template "/etc/logrotate.d/#{svc}" do - source "#{svc}.logrotate.erb" - owner "root" - group "root" - mode 0644 - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name - ) - end - - service "#{svc}" do - action [ :enable, :start ] - end -end - -http_request "compact chef couchDB" do - action :post - url "#{Chef::Config[:couchdb_url]}/chef/_compact" - only_if do - begin - open("#{Chef::Config[:couchdb_url]}/chef") - JSON::parse(open("#{Chef::Config[:couchdb_url]}/chef").read)["disk_size"] > 100_000_000 - rescue OpenURI::HTTPError - nil - end - end -end - -%w(nodes roles registrations clients data_bags data_bag_items users).each do |view| - http_request "compact chef couchDB view #{view}" do - action :post - url "#{Chef::Config[:couchdb_url]}/chef/_compact/#{view}" - only_if do - begin - open("#{Chef::Config[:couchdb_url]}/chef/_design/#{view}/_info") - JSON::parse(open("#{Chef::Config[:couchdb_url]}/chef/_design/#{view}/_info").read)["view_index"]["disk_size"] > 100_000_000 - rescue OpenURI::HTTPError - nil - end - end - end -end - -%w{chef-solr-rebuild}.each do |bin| - template "/usr/bin/#{bin}" do - source "rvm_wrapper.bin.erb" - owner "root" - group "root" - mode 0755 - variables( - :recipe_name => recipe_name, - :cookbook_name => cookbook_name, - :binary => bin - ) - end -end diff --git a/chef_rvm/recipes/server_proxy.rb b/chef_rvm/recipes/server_proxy.rb deleted file mode 100644 index c1d69e3..0000000 --- a/chef_rvm/recipes/server_proxy.rb +++ /dev/null @@ -1,59 +0,0 @@ -# -# Modified By:: Matthew Kent -# Original Author:: Joshua Timberman -# Cookbook Name:: chef_rvm -# Recipe:: server_proxy -# -# Copyright 2009, Opscode, Inc -# -# 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. - -node[:apache][:listen_ports] << "443" unless node[:apache][:listen_ports].include?("443") -if node[:chef_rvm][:webui_enabled] - node[:apache][:listen_ports] << "444" unless node[:apache][:listen_ports].include?("444") -end - -include_recipe "chef_rvm::server" -include_recipe "apache2" -include_recipe "apache2::mod_ssl" -include_recipe "apache2::mod_proxy" -include_recipe "apache2::mod_proxy_http" -include_recipe "apache2::mod_proxy_balancer" -include_recipe "apache2::mod_rewrite" -include_recipe "apache2::mod_headers" -include_recipe "apache2::mod_expires" -include_recipe "apache2::mod_deflate" - -directory "/etc/chef/certificates" do - owner "chef" - group "root" - mode "700" -end - -bash "Create SSL Certificates" do - cwd "/etc/chef/certificates" - code <<-EOH - umask 077 - openssl genrsa 2048 > #{node[:chef_rvm][:server_fqdn]}.key - openssl req -subj "#{node[:chef_rvm][:server_ssl_req]}" -new -x509 -nodes -sha1 -days 3650 -key #{node[:chef_rvm][:server_fqdn]}.key > #{node[:chef_rvm][:server_fqdn]}.crt - cat #{node[:chef_rvm][:server_fqdn]}.key #{node[:chef_rvm][:server_fqdn]}.crt > #{node[:chef_rvm][:server_fqdn]}.pem - EOH - not_if { ::File.exists?("/etc/chef/certificates/#{node[:chef_rvm][:server_fqdn]}.pem") } -end - -web_app "chef_server" do - template "chef_server.conf.erb" - server_name node[:chef_rvm][:server_fqdn] - server_aliases [ node[:hostname], node[:fqdn], node[:chef_rvm][:server_fqdn] ] - log_dir node[:apache][:log_dir] -end diff --git a/chef_rvm/templates/default/chef-client.init.erb b/chef_rvm/templates/default/chef-client.init.erb deleted file mode 100644 index 0316803..0000000 --- a/chef_rvm/templates/default/chef-client.init.erb +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash -# -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# chef-client Startup script for the Chef client -# -# chkconfig: - 98 02 -# description: Client component of the Chef systems integration framework. - -### BEGIN INIT INFO -# Provides: chef-client -# Required-Start: $local_fs $network $remote_fs -# Required-Stop: $local_fs $network $remote_fs -# Should-Start: $named $time -# Should-Stop: $named $time -# Short-Description: Startup script for the Chef client -# Description: Client component of the Chef systems integration framework. -### END INIT INFO - -# Source function library -. /etc/init.d/functions - -exec="/usr/bin/chef-client" -prog="chef-client" - -# Configuration file for the chef-client service -config=/etc/chef/client.rb -pidfile=<%= @node[:chef_rvm][:run_path] %>/client.pid -lockfile=/var/lock/subsys/$prog -logfile=<%= @node[:chef_rvm][:log_dir] %>/client.log -# Sleep interval between runs. -# This value is in seconds. -interval=<%= @node[:chef_rvm][:client_interval] %> -# Maximum amount of random delay before starting a run. Prevents every client -# from contacting the server at the exact same time. -# This value is in seconds. -splay=<%= @node[:chef_rvm][:client_splay] %> -# Any additional chef-client options. -options= - -start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - echo -n $"Starting $prog: " - daemon \ - $prog -d -c "$config" -L "$logfile" -i "$interval" -s "$splay" \ - -P "$pidfile" "$options" - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p $pidfile chef-client - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart () { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $pidfile $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/chef_rvm/templates/default/chef-client.logrotate.erb b/chef_rvm/templates/default/chef-client.logrotate.erb deleted file mode 100644 index 0cfc880..0000000 --- a/chef_rvm/templates/default/chef-client.logrotate.erb +++ /dev/null @@ -1,14 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -/var/log/chef/client.log { - rotate 12 - weekly - compress - postrotate - /etc/init.d/chef-client condrestart >/dev/null || : - endscript -} diff --git a/chef_rvm/templates/default/chef-server-webui.init.erb b/chef_rvm/templates/default/chef-server-webui.init.erb deleted file mode 100644 index bb7d26b..0000000 --- a/chef_rvm/templates/default/chef-server-webui.init.erb +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -# -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# chef-server-webui Startup script for chef-server-webui -# -# chkconfig: - 97 03 -# description: Server WebUI component of the Chef systems integration framework. - -### BEGIN INIT INFO -# Provides: chef-server-webui -# Required-Start: $local_fs $network $remote_fs chef-sever -# Required-Stop: $local_fs $network $remote_fs chef-server -# Should-Start: $named $time -# Should-Stop: $named $time -# Short-Description: Startup script for chef-server-webui -# Description: Server WebUI component of the Chef systems integration framework. -### END INIT INFO - -# Source function library -. /etc/init.d/functions - -exec="/usr/bin/chef-server-webui" -prog="chef-server-webui" - -# Configuration file for the chef-server-webui service -config=/etc/chef/webui.rb -pidfile=<%= @node[:chef_rvm][:run_path] %>/server-webui.main.pid -lockfile=/var/lock/subsys/$prog -logfile=<%= @node[:chef_rvm][:log_dir] %>/server-webui.log -port=4040 -env=production -adapter=thin -childpidfiles=<%= @node[:chef_rvm][:run_path] %>/server-webui.%s.pid -user=chef -group=chef -# Any additional chef-server-webui options. -options= - -start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - echo -n $"Starting $prog: " - daemon \ - $prog -d -C "$config" -L "$logfile" -p "$port" -e "$env" -a "$adapter" \ - -P "$childpidfiles" -u "$user" -G "$group" "$options" "&>/dev/null" - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p $pidfile $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart () { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $pidfile $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/chef_rvm/templates/default/chef-server-webui.logrotate.erb b/chef_rvm/templates/default/chef-server-webui.logrotate.erb deleted file mode 100644 index b4d2baf..0000000 --- a/chef_rvm/templates/default/chef-server-webui.logrotate.erb +++ /dev/null @@ -1,14 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -/var/log/chef/server-webui.log { - rotate 12 - weekly - compress - postrotate - /etc/init.d/chef-server-webui condrestart >/dev/null || : - endscript -} diff --git a/chef_rvm/templates/default/chef-server.init.erb b/chef_rvm/templates/default/chef-server.init.erb deleted file mode 100644 index f162811..0000000 --- a/chef_rvm/templates/default/chef-server.init.erb +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -# -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# chef-server Startup script for chef-server -# -# chkconfig: - 96 04 -# description: Server component of the Chef systems integration framework. - -### BEGIN INIT INFO -# Provides: chef-server -# Required-Start: $local_fs $network $remote_fs chef-solr chef-solr-indexer -# Required-Stop: $local_fs $network $remote_fs chef-solr chef-solr-indexer -# Should-Start: $named $time -# Should-Stop: $named $time -# Short-Description: Startup script for chef-server -# Description: Server component of the Chef systems integration framework. -### END INIT INFO - -# Source function library -. /etc/init.d/functions - -exec="/usr/bin/chef-server" -prog="chef-server" - -# Configuration file for the chef-server service -config=/etc/chef/server.rb -pidfile=<%= @node[:chef_rvm][:run_path] %>/server.main.pid -lockfile=/var/lock/subsys/$prog -logfile=<%= @node[:chef_rvm][:log_dir] %>/server.log -port=4000 -env=production -adapter=thin -childpidfiles=<%= @node[:chef_rvm][:run_path] %>/server.%s.pid -user=chef -group=chef -# Any additional chef-server options. -options= - -start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - echo -n $"Starting $prog: " - daemon \ - $prog -d -C "$config" -L "$logfile" -p "$port" -e "$env" -a "$adapter" \ - -P "$childpidfiles" -u "$user" -G "$group" "$options" "&>/dev/null" - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p $pidfile $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart () { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $pidfile $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/chef_rvm/templates/default/chef-server.logrotate.erb b/chef_rvm/templates/default/chef-server.logrotate.erb deleted file mode 100644 index ba11920..0000000 --- a/chef_rvm/templates/default/chef-server.logrotate.erb +++ /dev/null @@ -1,14 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -/var/log/chef/server.log { - rotate 12 - weekly - compress - postrotate - /etc/init.d/chef-server condrestart >/dev/null || : - endscript -} diff --git a/chef_rvm/templates/default/chef-solr-indexer.init.erb b/chef_rvm/templates/default/chef-solr-indexer.init.erb deleted file mode 100644 index 4efdb54..0000000 --- a/chef_rvm/templates/default/chef-solr-indexer.init.erb +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# chef-solr-indexer Startup script for the Chef search indexer -# -# chkconfig: - 95 05 -# description: Search indexer component of the Chef Server. - -### BEGIN INIT INFO -# Provides: chef-solr-indexer -# Required-Start: $local_fs $network $remote_fs chef-solr rabbitmq-server -# Required-Stop: $local_fs $network $remote_fs chef-solr rabbitmq-server -# Should-Start: $named $time -# Should-Stop: $named $time -# Short-Description: Startup script for the Chef search indexer -# Description: Search indexer component of the Chef Server. -### END INIT INFO - -# Source function library -. /etc/init.d/functions - -exec="/usr/bin/chef-solr-indexer" -prog="chef-solr-indexer" - -# Configuration file for the chef-solr-indexer service -config=/etc/chef/solr-indexer.rb -pidfile=<%= @node[:chef_rvm][:run_path] %>/solr-indexer.pid -lockfile=/var/lock/subsys/$prog -logfile=<%= @node[:chef_rvm][:log_dir] %>/solr-indexer.log -# Any additional chef-solr-indexer options. -options= - -start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - echo -n $"Starting $prog: " - daemon \ - $prog -d -c "$config" -L "$logfile" "$options" - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p $pidfile $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart () { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $pidfile $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/chef_rvm/templates/default/chef-solr-indexer.logrotate.erb b/chef_rvm/templates/default/chef-solr-indexer.logrotate.erb deleted file mode 100644 index bf4a2c4..0000000 --- a/chef_rvm/templates/default/chef-solr-indexer.logrotate.erb +++ /dev/null @@ -1,14 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -/var/log/chef/solr-indexer.log { - rotate 12 - weekly - compress - postrotate - /etc/init.d/chef-solr-indexer condrestart >/dev/null || : - endscript -} diff --git a/chef_rvm/templates/default/chef-solr.init.erb b/chef_rvm/templates/default/chef-solr.init.erb deleted file mode 100644 index 30aa09a..0000000 --- a/chef_rvm/templates/default/chef-solr.init.erb +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# chef-solr Startup script for the SOLR search engine -# -# chkconfig: - 94 06 -# description: SOLR search engine for the Chef Server. - -### BEGIN INIT INFO -# Provides: chef-solr -# Required-Start: $local_fs $network $remote_fs -# Required-Stop: $local_fs $network $remote_fs -# Should-Start: $named $time -# Should-Stop: $named $time -# Short-Description: Startup script for the SOLR search engine -# Description: SOLR search engine for the Chef Server. -### END INIT INFO - -# Source function library -. /etc/init.d/functions - -exec="/usr/bin/chef-solr" -prog="chef-solr" - -# Configuration file for the chef-solr service -config=/etc/chef/solr.rb -pidfile=<%= @node[:chef_rvm][:run_path] %>/solr.pid -lockfile=/var/lock/subsys/$prog -logfile=<%= @node[:chef_rvm][:log_dir] %>/solr.log -# Options for Java. Need to start with -j followed by options. -options= - -start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - echo -n $"Starting $prog: " - daemon \ - $prog -d -c "$config" -L "$logfile" "$options" - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p $pidfile $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart () { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $pidfile $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/chef_rvm/templates/default/chef-solr.logrotate.erb b/chef_rvm/templates/default/chef-solr.logrotate.erb deleted file mode 100644 index 44f9ec7..0000000 --- a/chef_rvm/templates/default/chef-solr.logrotate.erb +++ /dev/null @@ -1,14 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -/var/log/chef/solr.log { - rotate 12 - weekly - compress - postrotate - /etc/init.d/chef-solr condrestart >/dev/null || : - endscript -} diff --git a/chef_rvm/templates/default/chef_server.conf.erb b/chef_rvm/templates/default/chef_server.conf.erb deleted file mode 100644 index 985d20f..0000000 --- a/chef_rvm/templates/default/chef_server.conf.erb +++ /dev/null @@ -1,68 +0,0 @@ -# Server Proxy for API - - ServerName <%= @params[:server_name] %> - ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %> - - DocumentRoot <%= node[:chef_rvm][:doc_root] %> - - ExpiresActive On - ExpiresByType text/css "access plus <%= node[:chef_rvm][:server_proxy][:css_expire_hours] %> hours" - ExpiresByType text/javascript "access plus <%= node[:chef_rvm][:server_proxy][:js_expire_hours] %> hours" - ExpiresByType application/x-javascript "access plus <%= node[:chef_rvm][:server_proxy][:js_expire_hours] %> hours" - ExpiresByType application/javascript "access plus <%= node[:chef_rvm][:server_proxy][:js_expire_hours] %> hours" - - - BalancerMember http://127.0.0.1:<%= node[:chef_rvm][:server_port] %> - Order deny,allow - Allow from all - - - LogLevel info - ErrorLog <%= @params[:log_dir] %>/<%= @params[:name] %>-error.log - CustomLog <%= @params[:log_dir] %>/<%= @params[:name] %>-access.log combined - - SSLEngine On - SSLCertificateFile /etc/chef/certificates/<%= @params[:server_name] %>.pem - SSLCertificateKeyFile /etc/chef/certificates/<%= @params[:server_name] %>.pem - - RequestHeader set X_FORWARDED_PROTO 'https' - - RewriteEngine On - RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f - RewriteRule ^/(.*)$ balancer://chef_server%{REQUEST_URI} [P,QSA,L] - -<% if node[:chef_rvm][:webui_enabled] -%> -# Server Proxy for WebUI - - ServerName <%= @params[:server_name] %> - ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %> - - DocumentRoot <%= node[:chef_rvm][:doc_root] %> - - ExpiresActive On - ExpiresByType text/css "access plus <%= node[:chef_rvm][:server_proxy][:css_expire_hours] %> hours" - ExpiresByType text/javascript "access plus <%= node[:chef_rvm][:server_proxy][:js_expire_hours] %> hours" - ExpiresByType application/x-javascript "access plus <%= node[:chef_rvm][:server_proxy][:js_expire_hours] %> hours" - ExpiresByType application/javascript "access plus <%= node[:chef_rvm][:server_proxy][:js_expire_hours] %> hours" - - - BalancerMember http://127.0.0.1:<%= node[:chef_rvm][:webui_port] %> - Order deny,allow - Allow from all - - - LogLevel info - ErrorLog <%= @params[:log_dir] %>/<%= @params[:name] %>-error.log - CustomLog <%= @params[:log_dir] %>/<%= @params[:name] %>-access.log combined - - SSLEngine On - SSLCertificateFile /etc/chef/certificates/<%= @params[:server_name] %>.pem - SSLCertificateKeyFile /etc/chef/certificates/<%= @params[:server_name] %>.pem - - RequestHeader set X_FORWARDED_PROTO 'https' - - RewriteEngine On - RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f - RewriteRule ^/(.*)$ balancer://chef_server%{REQUEST_URI} [P,QSA,L] - -<% end -%> diff --git a/chef_rvm/templates/default/client.rb.erb b/chef_rvm/templates/default/client.rb.erb deleted file mode 100644 index 1ed3c1f..0000000 --- a/chef_rvm/templates/default/client.rb.erb +++ /dev/null @@ -1,93 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# Configuration File For Chef (chef-client) -# -# The chef-client program will connect the local system to the specified -# server URLs through a RESTful API to retrieve its configuration. -# -# The chef-client daemon reads this file by default. -# -# This is a Ruby DSL config file, and can embed regular Ruby code in addition to -# the configuration settings. Some settings use Ruby symbols, which are a value -# that starts with a colon. In Ruby, anything but 'false' or 'nil' is true. To -# set something to false: -# -# some_setting false -# -# log_level specifies the level of verbosity for output. -# valid values are: :debug, :info, :warn, :error, :fatal. -# Corresponds to chef-client -l - -log_level :info - -# log_location specifies where the client should log to. -# valid values are: a quoted string specifying a file, or STDOUT with -# no quotes. STDOUT is a constant in Ruby. -# Corresponds to chef-client -L, and use -V with chef-client to ensure output -# also goes to STDOUT if this value is changed. The chef-client daemon is -# configured to log to /var/log/chef/client.log in /etc/default/chef-client. - -log_location STDOUT - -# ssl_verify_mode specifies if the REST client should verify SSL certificates. -# valid values are :verify_none, :verify_peer. The default Chef Server -# installation on Debian will use a self-generated SSL certificate so this -# should be :verify_none unless you replace the certificate. - -ssl_verify_mode :verify_none - -# chef_server_url specifies the Chef Server to connect to. -# valid values are any HTTP URL. -# Corresponds to chef-client -S - -chef_server_url "<%= node[:chef_rvm][:server_url] %>" - -# file_cache_path specifies where the client should cache cookbooks, server -# cookie ID, and openid registration data. -# valid value is any filesystem directory location. - -file_cache_path "<%= node[:chef_rvm][:cache_path] %>" - -# file_backup_path specifies where chef will store backups of replaced files -# from template, cookbook_file and remote_file resources. - -<% if node[:chef_rvm][:backup_path] -%> -file_backup_path "<%= node[:chef_rvm][:backup_path] %>" -<% else -%> -file_backup_path nil -<% end -%> - -# pid_file specifies the location of where chef-client daemon should keep the pid -# file. -# valid value is any filesystem file location. - -pid_file "<%= node[:chef_rvm][:run_path] %>/client.pid" - -# cache_options sets options used by the moneta library for local cache -# for checksums of compared objects. - -cache_options({ :path => "<%= node[:chef_rvm][:cache_path] %>/checksums", :skip_expires => true}) - -# signing_ca_user is used when generating the certificates used by chef to -# set the owner of the keyfile. This is set to chef so services that run -# as the chef user can read the file. - -signing_ca_user "chef" - -# Mixlib::Log::Formatter.show_time specifies whether the log should -# contain timestamps. -# valid values are true or false. The printed timestamp is rfc2822, for example: -# Fri, 31 Jul 2009 19:19:46 -0600 - -Mixlib::Log::Formatter.show_time = true - -validation_client_name "chef-validator" -validation_key "/etc/chef/validation.pem" -client_key "/etc/chef/client.pem" - -# Don't run this by default - some system have 60k of accounts -Ohai::Config[:disabled_plugins] = [ 'passwd' ] diff --git a/chef_rvm/templates/default/rvm_wrapper.bin.erb b/chef_rvm/templates/default/rvm_wrapper.bin.erb deleted file mode 100644 index c93ebca..0000000 --- a/chef_rvm/templates/default/rvm_wrapper.bin.erb +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -exec <%= @node[:chef_rvm][:rvm_binary] %> <%= @node[:chef_rvm][:rvm_ruby] %> exec <%= @binary %> $@ diff --git a/chef_rvm/templates/default/server.rb.erb b/chef_rvm/templates/default/server.rb.erb deleted file mode 100644 index 9617fb0..0000000 --- a/chef_rvm/templates/default/server.rb.erb +++ /dev/null @@ -1,156 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# Configuration File For Chef (chef-server) -# -# chef-server is a Merb application slice that provides the Chef API. -# -# By default it is configured to run via Thin. It can be run manually as: -# -# chef-server -p 4000 -e production -a thin -# -# This starts up the RESTful Chef Server API on port 4000 in production mode -# using the thin server adapter. -# -# This file configures the behavior of the running server itself. -# -# It is a Ruby DSL config file, and can embed regular Ruby code in addition to -# the configuration settings. Some settings use Ruby symbols, which are a value -# that starts with a colon. In Ruby, anything but 'false' or 'nil' is true. To -# set something to false: -# -# some_setting false -# -# log_level specifies the level of verbosity for output. -# valid values are: :debug, :info, :warn, :error, :fatal - -# Default is :info, see http://tickets.opscode.com/browse/CHEF-1122 -log_level :warn - -# log_location specifies where the server should log to. -# valid values are: a quoted string specifying a file, or STDOUT with -# no quotes. This is the application log for the Merb workers that get -# spawned. The chef-server daemon is configured to log to -# /var/log/chef/server.log in /etc/chef/default/chef-server. - -log_location STDOUT - -# ssl_verify_mode specifies if the REST client should verify SSL certificates. -# valid values are :verify_none, :verify_peer. The default Chef Server -# installation on Debian will use a self-generated SSL certificate so this -# should be :verify_none unless you replace the certificate. - -ssl_verify_mode :verify_none - -# chef_server_url specifies the URL for the server API. The process actually -# listens on 0.0.0.0:PORT. valid values are any HTTP URL. To change the port -# the server listens on, modify the server_port in the attributes. - -chef_server_url "<%= node[:chef_rvm][:server_url] %>" - -# cookbook_path is a Ruby array of filesystem locations to search for cookbooks -# that are available for clients. This is also where cookbooks uploaded via -# 'knife' are stored. -# -# valid value is a string, or an array of strings of filesystem directory locations. -# This setting is searched beginning (index 0) to end in order. You might specify -# multiple search paths for cookbooks if you want to use an upstream source, and -# provide localised "site" overrides. These should come after the 'upstream' source. -# The default value, /var/lib/chef/cookbooks does not contain any cookbooks by default. -# -# See the Chef Wiki for more information about setting up a local repository for -# working on cookbooks: http://wiki.opscode.com/display/chef/Chef+Repository - -cookbook_path [ "<%= node[:chef_rvm][:serve_path] %>/cookbooks", "<%= node[:chef_rvm][:serve_path] %>/site-cookbooks" ] - -# cookbook_tarball_path is the location where the server will store uploaded -# cookbook tarballs. These tarballs can be downloaded with knife, for -# redistribution. - -cookbook_tarball_path "<%= node[:chef_rvm][:serve_path] %>/cookbook-tarballs" - -# sandbox_path is the location where the chef server temporarily stores files -# uploaded for cookbooks. - -sandbox_path "<%= node[:chef_rvm][:cache_path] %>/sandboxes" - -# file_cache_path specifies where chef should cache cookbooks, server -# cookie ID, and openid registration data. -# valid value is any filesystem directory location. - -file_cache_path "<%= node[:chef_rvm][:cache_path] %>" - -# node_path specifies a location for where to find node-specific recipes. -# valid values are any filesystem direcory location. - -node_path "<%= node[:chef_rvm][:serve_path] %>/nodes" - -# openid_store_path specifies a location where to keep openid nonces for clients. -# valid values are any filesystem directory location. -# -# NOTE: OpenID is deprecated and this option may not be used, kept for -# historical purposes because the default in Chef is not FHS compliant, and -# may be removed in a future version. - -openid_store_path "<%= node[:chef_rvm][:path] %>/openid/store" - -# openid_store_path specifies a location where to keep openid nonces for clients. -# valid values are any filesystem directory location. -# -# NOTE: OpenID is deprecated and this option may not be used, kept for -# historical purposes because the default in Chef is not FHS compliant, and -# may be removed in a future version. - -openid_cstore_path "<%= node[:chef_rvm][:path] %>/openid/cstore" - -# role_path designates where the server should load role JSON and Ruby DSL -# files from. -# valid values are any filesystem directory location. Roles are a feature -# that allow you to easily reuse lists of recipes and attribute settings. -# Please see the Chef Wiki page for information on how to utilize the feature. -# http://wiki.opscode.com/display/chef/Roles -# -# NOTE: The role_path setting is deprecated on the chef-server, as the -# roles are now stored directly in CouchDB rather than on the filesystem. -# This option is kept for historical purposes because the default in Chef is -# not FHS compliant, and may be removed in a future version. - -#role_path "<%= node[:chef_rvm][:serve_path] %>/roles" - -# cache_options sets options used by the moneta library for local cache -# for checksums of compared objects. - -cache_options({ :path => "<%= node[:chef_rvm][:cache_path] %>/checksums", :skip_expires => true}) - -# checksum_path sets the location for file checksums on sandbox uploads. - -checksum_path "<%= node[:chef_rvm][:cache_path] %>/sandbox_checksums" - -# Mixlib::Log::Formatter.show_time specifies whether the chef-client log should -# contain timestamps. -# valid values are true or false (no quotes, see above about Ruby idioms). The -# printed timestamp is rfc2822, for example: -# Fri, 31 Jul 2009 19:19:46 -0600 - -Mixlib::Log::Formatter.show_time = true - -# The following options configure the signing CA so it can be read by -# non-privileged user for the server daemon. - -signing_ca_cert "/etc/chef/certificates/cert.pem" -signing_ca_key "/etc/chef/certificates/key.pem" -signing_ca_user "chef" -signing_ca_group "chef" - -# rabbitmq password -#amqp_pass File.read('/etc/chef/amqp_passwd').chomp - -couchdb_database "chef" -umask 0022 - -validation_client_name "chef-validator" -validation_key "/etc/chef/validation.pem" -client_key "/etc/chef/client.pem" diff --git a/chef_rvm/templates/default/solo.rb.erb b/chef_rvm/templates/default/solo.rb.erb deleted file mode 100644 index 63ac499..0000000 --- a/chef_rvm/templates/default/solo.rb.erb +++ /dev/null @@ -1,76 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# Configuration File For Chef Solo (chef-solo) -# -# The program chef-solo allows you to run Chef as a standalone program -# without connecting to a remote Chef Server. -# -# When invoked without the -c option, chef-solo reads this file by default, -# otherwise it reads the specified file for configuration. -# -# It is a Ruby DSL config file, and can embed regular Ruby code in addition to -# the configuration settings. Some settings use Ruby symbols, which are a value -# that starts with a colon. In Ruby, anything but 'false' or 'nil' is true. To -# set something to false: -# -# some_setting false -# -# log_level specifies the level of verbosity for output. -# valid values are: :debug, :info, :warn, :error, :fatal -# Corresponds to chef-solo -l - -log_level :info - -# log_location specifies where the client should log to. -# valid values are: a quoted string specifying a file, or STDOUT with -# no quotes. -# Corresponds to chef-solo -L - -log_location STDOUT - -# file_cache_path specifies where solo should look for the cookbooks to use -# valid value is any filesystem directory location. This is slightly -# different from 'normal' client mode as solo is actually downloading (or -# using) the specified cookbooks in this location. - -file_cache_path "<%= node[:chef_rvm][:cache_path] %>" - -# cookbook_path specifies where solo should look for cookbooks it will use. -# valid value is a string, or array of strings of filesystem directory locations. -# This setting is similar to the server setting of the same name. Solo will use -# this as a search location, in Array order. It should be a subdirectory of -# file_cache_path, above. - -cookbook_path [ "<%= node[:chef_rvm][:serve_path] %>/cookbooks", "<%= node[:chef_rvm][:serve_path] %>/site-cookbooks" ] - -# role_path designates where the server should load role JSON and Ruby DSL -# files from. -# valid values are any filesystem directory location. Roles are a feature -# that allow you to easily reuse lists of recipes and attribute settings. -# Please see the Chef Wiki page for information on how to utilize the feature. -# http://wiki.opscode.com/display/chef/Roles - -role_path [ "<%= node[:chef_rvm][:serve_path] %>/roles" ] - -# recipe_url specifies a remote URL to retrieve a tarball of cookbooks. -# Corresponds to chef-solo -r - -#recipe_url "http://www.example.com/chef/cookbooks.tar.gz" - -# json_attribs specifies a local or remote JSON data file that specifies -# attributes and a run_list that Chef will use to configure the system. -# Corresponds to chef-solo -j - -#json_attribs "/var/tmp/node.json" -#json_attribs "http://www.example.com/chef/node.json" - -# Mixlib::Log::Formatter.show_time specifies whether the log should -# contain timestamps. -# valid values are true or false. The printed timestamp is rfc2822, for example: -# Fri, 31 Jul 2009 19:19:46 -0600 - -Mixlib::Log::Formatter.show_time = true diff --git a/chef_rvm/templates/default/solr-indexer.rb.erb b/chef_rvm/templates/default/solr-indexer.rb.erb deleted file mode 100644 index 4abd58a..0000000 --- a/chef_rvm/templates/default/solr-indexer.rb.erb +++ /dev/null @@ -1,62 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# Configuration File For Chef SOLR (chef-solr-indexer) -# -# chef-solr-indexer daemon reads this configuration file on startup, as set in -# /etc/default/chef-solr-indexer. -# -# It is a Ruby DSL config file, and can embed regular Ruby code in addition to -# the configuration settings. Some settings use Ruby symbols, which are a value -# that starts with a colon. In Ruby, anything but 'false' or 'nil' is true. To -# set something to false: -# -# some_setting false -# -# log_location specifies where the indexer should log to. -# valid values are: a quoted string specifying a file, or STDOUT with -# no quotes. -# Corresponds to chef-solr-indexer -L -# -# The chef-solr-indexer daemon is configured to log to /var/log/chef/solr.log -# by default. - -log_location STDOUT - -# search_index_path specifies where the indexer should store the indexes. -# valid value is any filesystem directory location. - -search_index_path "<%= node[:chef_rvm][:path] %>/search_index" - -solr_jetty_path "<%= node[:chef_rvm][:path] %>/solr/solr-jetty" -solr_home_path "<%= node[:chef_rvm][:path] %>/solr" -solr_data_path "<%= node[:chef_rvm][:cache_path] %>/solr/data" -solr_heap_size "<%= node[:chef_rvm][:solr_heap_size] %>" - -# specifies the URL of the SOLR instance for the indexer to connect to. - -solr_url "http://localhost:8983" - -# uses the solr_jetty_path option set above, and the etc directory is -# actually a symbolic link to /etc/chef/solr-jetty. - -#solr_java_opts "-DSTART=#{Chef::Config[:solr_jetty_path]}/etc/start.config" - -# Mixlib::Log::Formatter.show_time specifies whether the log should -# contain timestamps. -# valid values are true or false. The printed timestamp is rfc2822, for example: -# Fri, 31 Jul 2009 19:19:46 -0600 - -Mixlib::Log::Formatter.show_time = true - -# pid_file specifies the location of where chef-client daemon should keep the pid -# file. -# valid value is any filesystem file location. - -pid_file "<%= node[:chef_rvm][:run_path] %>/solr-indexer.pid" - -user "chef" -group "chef" diff --git a/chef_rvm/templates/default/solr.rb.erb b/chef_rvm/templates/default/solr.rb.erb deleted file mode 100644 index 3fc55a2..0000000 --- a/chef_rvm/templates/default/solr.rb.erb +++ /dev/null @@ -1,62 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# Configuration File For Chef SOLR (chef-solr) -# -# chef-solr daemon reads this configuration file on startup, as set in -# /etc/default/chef-solr. -# -# It is a Ruby DSL config file, and can embed regular Ruby code in addition to -# the configuration settings. Some settings use Ruby symbols, which are a value -# that starts with a colon. In Ruby, anything but 'false' or 'nil' is true. To -# set something to false: -# -# some_setting false -# -# log_location specifies where the indexer should log to. -# valid values are: a quoted string specifying a file, or STDOUT with -# no quotes. -# Corresponds to chef-solr -L -# -# The chef-solr daemon is configured to log to /var/log/chef/solr.log by -# default. - -log_location STDOUT - -# search_index_path specifies where the indexer should store the indexes. -# valid value is any filesystem directory location. - -search_index_path "<%= node[:chef_rvm][:path] %>/search_index" - -solr_jetty_path "<%= node[:chef_rvm][:path] %>/solr/jetty" -solr_home_path "<%= node[:chef_rvm][:path] %>/solr/home" -solr_data_path "<%= node[:chef_rvm][:cache_path] %>/solr/data" -solr_heap_size "<%= node[:chef_rvm][:solr_heap_size] %>" - -# specifies the URL of the SOLR instance for the indexer to connect to. - -solr_url "http://localhost:8983" - -# uses the solr_jetty_path option set above, and the etc directory is -# actually a symbolic link to /etc/chef/solr-jetty. - -#solr_java_opts "-DSTART=#{Chef::Config[:solr_jetty_path]}/etc/start.config" - -# Mixlib::Log::Formatter.show_time specifies whether the log should -# contain timestamps. -# valid values are true or false. The printed timestamp is rfc2822, for example: -# Fri, 31 Jul 2009 19:19:46 -0600 - -Mixlib::Log::Formatter.show_time = true - -# pid_file specifies the location of where chef-client daemon should keep the pid -# file. -# valid value is any filesystem file location. - -pid_file "<%= node[:chef_rvm][:run_path] %>/solr.pid" - -user "chef" -group "chef" diff --git a/chef_rvm/templates/default/webui.rb.erb b/chef_rvm/templates/default/webui.rb.erb deleted file mode 100644 index f6939fb..0000000 --- a/chef_rvm/templates/default/webui.rb.erb +++ /dev/null @@ -1,120 +0,0 @@ -# Dynamically generated by Chef for <%= @node[:fqdn] %> - -# local modifications will be replaced. -# -# Cookbook: <%= @cookbook_name %> -# Recipe: <%= @recipe_name %> -# -# Configuration File For Chef (chef-server-webui) -# -# chef-server-webui is a Merb application slice that provides a web user -# interface to the Chef Server. The WebUI is optional as of version 0.8.0+, -# and is a client to the API itself, which can be running on the same server, -# or optionally on a different server. -# -# By default, it is configured to run via Thin. It can be run manually as: -# -# chef-server-webui -p 4040 -e production -a thin -# -# This starts up the Chef Server WebUI on port 4040 in production mode using -# the thin server adapter. -# -# This file configures the behavior of the running server-webui itself. -# -# It is a Ruby DSL config file, and can embed regular Ruby code in addition to -# the configuration settings. Some settings use Ruby symbols, which are a value -# that starts with a colon. In Ruby, anything but 'false' or 'nil' is true. To -# set something to false: -# -# some_setting false -# -# log_level specifies the level of verbosity for output. -# valid values are: :debug, :info, :warn, :error, :fatal - -log_level :info - -# log_location specifies where the server should log to. -# valid values are: a quoted string specifying a file, or STDOUT with -# no quotes. This is the application log for the Merb workers that get -# spawned. The chef-server-webui daemon is configured to log to -# /var/log/chef/server-webui.log by default. - -log_location STDOUT - -# ssl_verify_mode specifies if the REST client should verify SSL certificates. -# valid values are :verify_none, :verify_peer. The default Chef Server -# installation on Debian will use a self-generated SSL certificate so this -# should be :verify_none unless you replace the certificate. - -ssl_verify_mode :verify_none - -# chef_server_url specifies the URL for the server API. The process actually -# listens on 0.0.0.0:PORT. -# valid values are any HTTP URL. If the server API port is changed, this -# value needs to be updated as well. - -chef_server_url "<%= node[:chef_rvm][:server_url] %>" - -# file_cache_path specifies where the client should cache cookbooks, server -# cookie ID, and openid registration data. -# valid value is any filesystem directory location. - -file_cache_path "<%= node[:chef_rvm][:cache_path] %>" - -# openid_store_path specifies a location where to keep openid nonces for clients. -# valid values are any filesystem directory location. -# -# NOTE: OpenID is optionally used in the WebUI to associate OpenIDs with webui -# users. - -openid_store_path "<%= node[:chef_rvm][:path] %>/openid/store" - -# openid_store_path specifies a location where to keep openid nonces for clients. -# valid values are any filesystem directory location. -# -# NOTE: OpenID is optionally used in the WebUI to associate OpenIDs with webui -# users. - -openid_cstore_path "<%= node[:chef_rvm][:path] %>/openid/cstore" - -# Mixlib::Log::Formatter.show_time specifies whether the chef-client log should -# contain timestamps. -# valid values are true or false. The printed timestamp is rfc2822, for example: -# Fri, 31 Jul 2009 19:19:46 -0600 - -Mixlib::Log::Formatter.show_time = true - -# The following options configure the signing CA so it can be read by -# non-privileged user for the server daemon. - -signing_ca_cert "/etc/chef/certificates/cert.pem" -signing_ca_key "/etc/chef/certificates/key.pem" -signing_ca_user "chef" -signing_ca_group "chef" - -# web_ui_client_name specifies the user to use when accessing the Chef -# Server API. By default this is already set to "chef-webui". -# -# This user gets created by the chef-server and stored in CouchDB the -# first time the server starts up if the user and key don't exist. - -web_ui_client_name "chef-webui" - -# web_ui_admin_user_name and web_ui_admin_default_password specify the -# user and password that a human can use to initially log into the -# chef-server-webui when it starts. The default value for the user is 'admin' -# and the default password is'p@ssw0rd1' should be changed immediately on -# login. The web form will display the password reset page on first login. -# During package installation, debconf will prompt for a password, so this -# may differ from the default. - -web_ui_admin_user_name "admin" -web_ui_admin_default_password "p@ssw0rd1" - -# web_ui_key specifics the file to use for authenticating with the Chef -# Server API. By default this is already set to "/etc/chef/webui.pem". -# -# This file gets created by the chef-server and the public key stored in -# CouchDB the first time the server starts up if the user and key don't -# exist. - -web_ui_key "/etc/chef/webui.pem" diff --git a/rabbitmq_chef/metadata.rb b/rabbitmq_chef/metadata.rb deleted file mode 100644 index 5eb9931..0000000 --- a/rabbitmq_chef/metadata.rb +++ /dev/null @@ -1,13 +0,0 @@ -maintainer "Matthew Kent" -maintainer_email "mkent@magoazul.com" -license "Apache 2.0" -description "Installs the RabbitMQ AMQP Broker for use on a Chef Server." -version "0.1" - -recipe "rabbitmq_chef", "Install and configure rabbitmq specifically for a Chef Server" - -depends "erlang" - -%w{ centos redhat }.each do |os| - supports os -end diff --git a/rabbitmq_chef/recipes/default.rb b/rabbitmq_chef/recipes/default.rb deleted file mode 100644 index 1ca4bc0..0000000 --- a/rabbitmq_chef/recipes/default.rb +++ /dev/null @@ -1,47 +0,0 @@ -# -# Modified By:: Matthew Kent -# Original Author:: Daniel DeLeo -# Cookbook Name:: rabbitmq -# Recipe:: default -# -# Copyright 2009, Daniel DeLeo -# -# 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. - -package "rabbitmq-server" do - action :install -end - -service "rabbitmq-server" do - start_command "/sbin/service rabbitmq-server start &> /dev/null" - stop_command "/sbin/service rabbitmq-server stop &> /dev/null" - - supports [ :restart, :status ] - action [ :enable, :start ] -end - -# add a chef vhost to the queue -execute "rabbitmqctl add_vhost /chef" do - not_if "rabbitmqctl list_vhosts| grep /chef" -end - -# create chef user for the queue -execute "rabbitmqctl add_user chef testing" do - not_if "rabbitmqctl list_users |grep chef" -end - -# grant the mapper user the ability to do anything with the /chef vhost -# the three regex's map to config, write, read permissions respectively -execute 'rabbitmqctl set_permissions -p /chef chef ".*" ".*" ".*"' do - not_if 'rabbitmqctl list_user_permissions chef|grep /chef' -end