Skip to content

Commit

Permalink
Merge branch 'master' into basho_riak
Browse files Browse the repository at this point in the history
  • Loading branch information
b committed Jun 10, 2010
2 parents 684bb8e + 521c8f4 commit 05d5c24
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 58 deletions.
1 change: 1 addition & 0 deletions 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__), ".."))
Expand Down
3 changes: 3 additions & 0 deletions bootstrap/recipes/client.rb
Expand Up @@ -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" },
Expand Down
3 changes: 3 additions & 0 deletions bootstrap/recipes/server.rb
Expand Up @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion chef/attributes/default.rb
Expand Up @@ -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}"
2 changes: 2 additions & 0 deletions chef/attributes/server_proxy.rb
Expand Up @@ -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/" +
Expand Down
4 changes: 2 additions & 2 deletions chef/recipes/bootstrap_server.rb
Expand Up @@ -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")
Expand Down Expand Up @@ -159,7 +159,7 @@
end

service "#{svc}" do
action :enable
action [ :enable, :start ]
end
end

Expand Down
7 changes: 6 additions & 1 deletion runit/recipes/default.rb
Expand Up @@ -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 },
Expand Down
6 changes: 3 additions & 3 deletions ssh_known_hosts/README.rdoc
Expand Up @@ -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 (<scott@likens.us>)

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.
Expand Down
41 changes: 13 additions & 28 deletions 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 (<scott@likens.us>)\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 (<scott@likens.us>)\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"
}
6 changes: 1 addition & 5 deletions ssh_known_hosts/metadata.rb
Expand Up @@ -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
21 changes: 6 additions & 15 deletions ssh_known_hosts/recipes/default.rb
Expand Up @@ -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
)
Expand Down
5 changes: 2 additions & 3 deletions 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 -%>

0 comments on commit 05d5c24

Please sign in to comment.