Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Commit

Permalink
bump version for ssh_known_hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Jun 7, 2010
2 parents 61e4a58 + d98dd33 commit d2e1521
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 54 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
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 d2e1521

Please sign in to comment.