diff --git a/Rakefile b/Rakefile index c3ad87968..aebf7b0f6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,7 @@ require 'rubygems' require 'chef' require 'json' +TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), "..")) TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), "..")) diff --git a/bootstrap/recipes/client.rb b/bootstrap/recipes/client.rb index 4caf82176..9fec7e37a 100644 --- a/bootstrap/recipes/client.rb +++ b/bootstrap/recipes/client.rb @@ -17,6 +17,9 @@ # limitations under the License. # +Chef::Log.warn("This recipe will be deprecated soon, please use chef::bootstrap_client") +Chef::Log.warn("See the 'chef' cookbook's README.md for more information.") + root_group = value_for_platform( "openbsd" => { "default" => "wheel" }, "freebsd" => { "default" => "wheel" }, diff --git a/bootstrap/recipes/server.rb b/bootstrap/recipes/server.rb index 574daf042..caaed7260 100644 --- a/bootstrap/recipes/server.rb +++ b/bootstrap/recipes/server.rb @@ -21,6 +21,9 @@ # limitations under the License. # +Chef::Log.warn("This recipe will be deprecated soon, please use chef::bootstrap_server") +Chef::Log.warn("See the 'chef' cookbook's README.md for more information.") + root_group = value_for_platform( "openbsd" => { "default" => "wheel" }, "freebsd" => { "default" => "wheel" }, diff --git a/chef/attributes/default.rb b/chef/attributes/default.rb index a3873ac8f..b1ac488c3 100644 --- a/chef/attributes/default.rb +++ b/chef/attributes/default.rb @@ -44,5 +44,5 @@ set_unless[:chef][:webui_enabled] = false set_unless[:chef][:validation_client_name] = "chef-validator" -set_unless[:chef][:server_fqdn] = node.has_key?(domain) ? "chef.#{domain}" : "chef" +set_unless[:chef][:server_fqdn] = node.has_key?(:domain) ? "chef.#{domain}" : "chef" set_unless[:chef][:server_url] = "#{node.chef.url_type}://#{node.chef.server_fqdn}:#{node.chef.server_port}" diff --git a/chef/attributes/server_proxy.rb b/chef/attributes/server_proxy.rb index 19ba79857..369cde6f1 100644 --- a/chef/attributes/server_proxy.rb +++ b/chef/attributes/server_proxy.rb @@ -17,6 +17,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +include_attribute "chef" + set_unless[:chef][:doc_root] = "#{languages[:ruby][:gems_dir]}/gems/chef-server-webui-#{chef[:server_version]}/public" set_unless[:chef][:server_ssl_req] = "/C=US/ST=Several/L=Locality/O=Example/OU=Operations/" + diff --git a/chef/recipes/bootstrap_server.rb b/chef/recipes/bootstrap_server.rb index b39531c9b..38486030a 100644 --- a/chef/recipes/bootstrap_server.rb +++ b/chef/recipes/bootstrap_server.rb @@ -62,7 +62,7 @@ include_recipe "zlib" include_recipe "xml" -server_gems = %w{ chef-server chef-server-api chef-solr } +server_gems = %w{ chef-server-api chef-solr } server_services = %w{ chef-server chef-solr chef-solr-indexer } if node.chef.attribute?("webui_enabled") @@ -159,7 +159,7 @@ end service "#{svc}" do - action :enable + action [ :enable, :start ] end end diff --git a/runit/recipes/default.rb b/runit/recipes/default.rb index b6c7ea451..1a5485c46 100644 --- a/runit/recipes/default.rb +++ b/runit/recipes/default.rb @@ -40,7 +40,12 @@ end notifies value_for_platform( "debian" => { "4.0" => :run, "default" => :nothing }, - "ubuntu" => { "default" => :run, "9.10" => :nothing } + "ubuntu" => { + "default" => :nothing, + "9.04" => :run, + "8.10" => :run, + "8.04" => :run + } ), resources(:execute => "start-runsvdir"), :immediately notifies value_for_platform( "debian" => { "squeeze/sid" => :run, "default" => :nothing }, diff --git a/ssh_known_hosts/README.rdoc b/ssh_known_hosts/README.rdoc index 2b9bc6826..826542efd 100644 --- a/ssh_known_hosts/README.rdoc +++ b/ssh_known_hosts/README.rdoc @@ -6,15 +6,15 @@ Build /etc/ssh/known_hosts based on search indexes and build it based on data re == Platform: Doesn't matter, should work on anything. -= USAGE: += ATTRIBUTES: -Generates /etc/ssh/known_hosts based on search indexes for RSA keys. += USAGE: Generates /etc/ssh/known_hosts based on search indexes. = LICENSE and AUTHOR: Author:: Scott M. Likens () -Copyright:: 2009, Scott M. Likens +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. diff --git a/ssh_known_hosts/metadata.json b/ssh_known_hosts/metadata.json index 5d1bcc914..ef269546a 100644 --- a/ssh_known_hosts/metadata.json +++ b/ssh_known_hosts/metadata.json @@ -1,45 +1,30 @@ { - "maintainer": "Scott M. Likens", - "attributes": { + "replacing": { }, - "suggestions": { + "attributes": { }, "platforms": { - "ubuntu": [ - - ], - "fedora": [ - - ], - "centos": [ - - ], - "debian": [ - - ], - "redhat": [ - - ] + }, + "groupings": { }, "dependencies": { }, - "maintainer_email": "scott@likens.us", - "conflicting": { + "long_description": "= DESCRIPTION: \n\nBuild /etc/ssh/known_hosts based on search indexes and build it based on data retrieved by ohai.\n\n= REQUIREMENTS: \n\n== Platform: Doesn't matter, should work on anything.\n\n= ATTRIBUTES:\n\n= USAGE: Generates /etc/ssh/known_hosts based on search indexes.\n\n= LICENSE and AUTHOR: \n\nAuthor:: Scott M. Likens ()\n\nCopyright:: 2009, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n", + "recommendations": { }, - "version": "0.1.0", + "version": "0.2.0", + "maintainer": "Scott M. Likens", "name": "ssh_known_hosts", + "suggestions": { + }, "recipes": { "ssh_known_hosts::default": "Dyanmically generates /etc/ssh/known_hosts based on search indexes" }, - "providing": { - }, "license": "Apache 2.0", - "replacing": { - }, - "groupings": { + "maintainer_email": "scott@likens.us", + "conflicting": { }, - "long_description": "= DESCRIPTION: \n\nBuild /etc/ssh/known_hosts based on search indexes and build it based on data retrieved by ohai.\n\n= REQUIREMENTS: \n\n== Platform: Doesn't matter, should work on anything.\n\n= USAGE:\n\nGenerates /etc/ssh/known_hosts based on search indexes for RSA keys.\n\n= LICENSE and AUTHOR: \n\nAuthor:: Scott M. Likens ()\n\nCopyright:: 2009, Scott M. Likens\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n", - "recommendations": { + "providing": { }, "description": "Dyanmically generates /etc/ssh/known_hosts based on search indexes" } \ No newline at end of file diff --git a/ssh_known_hosts/metadata.rb b/ssh_known_hosts/metadata.rb index dde60b31d..c330f6061 100644 --- a/ssh_known_hosts/metadata.rb +++ b/ssh_known_hosts/metadata.rb @@ -3,9 +3,5 @@ license "Apache 2.0" description "Dyanmically generates /etc/ssh/known_hosts based on search indexes" long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) -version "0.1" +version "0.2.0" recipe "ssh_known_hosts::default", "Dyanmically generates /etc/ssh/known_hosts based on search indexes" - -%w{ redhat centos fedora ubuntu debian }.each do |os| - supports os -end diff --git a/ssh_known_hosts/recipes/default.rb b/ssh_known_hosts/recipes/default.rb index 9cdda3ce7..970831034 100644 --- a/ssh_known_hosts/recipes/default.rb +++ b/ssh_known_hosts/recipes/default.rb @@ -2,29 +2,20 @@ # Cookbook Name:: ssh_known_hosts # Recipe:: default # -# Copyright 2009, Scott M. Likens -# -# 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. -# +# Copyright 2009, Adapp, Inc. +sleep 2 nodes = [] -search(:node, "*", %w{ keys_ssh_host_rsa_public ipaddress hostname }) {|n| nodes << n} +search(:node, "*:*") do |z| + nodes << z +end template "/etc/ssh/ssh_known_hosts" do source "known_hosts.erb" mode 0440 owner "root" group "root" + backup false variables( :nodes => nodes ) diff --git a/ssh_known_hosts/templates/default/known_hosts.erb b/ssh_known_hosts/templates/default/known_hosts.erb index 6dc743997..d2f87aa7c 100644 --- a/ssh_known_hosts/templates/default/known_hosts.erb +++ b/ssh_known_hosts/templates/default/known_hosts.erb @@ -1,6 +1,5 @@ # THIS FILE IS MAINTAINED BY CHEF, DO NOT MODIFY AS IT WILL BE OVERWRITTEN <% @nodes.each do |n| -%> - <% if n.has_key?('keys_ssh_host_rsa_public') && n['keys_ssh_host_rsa_public'].length > 0 -%> -<%= n['hostname'] %>,<%= n['ipaddress'] %> ssh-rsa <%= n['keys_ssh_host_rsa_public'] %> - <% end -%> +<%= n['hostname'] %>,<%= n['ipaddress'] %> ssh-rsa <%= n['keys']['ssh']['host_rsa_public'] %> +<%= n['hostname'] %>,<%= n['ipaddress'] %> ssh-dsa <%= n['keys']['ssh']['host_dsa_public'] %> <% end -%>