forked from chef-boneyard/cookbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow adding custom SSH known_hosts from a data bag
My use case for this is for adding github.com so I can clone a repo I need
- Loading branch information
1 parent
3f0e490
commit d63b071
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# THIS FILE IS MAINTAINED BY CHEF, DO NOT MODIFY AS IT WILL BE OVERWRITTEN | ||
<% @nodes.each do |n| -%> | ||
<%= n['hostname'] %>,<%= n['fqdn'] %>,<%= n['ipaddress'] %> ssh-rsa <%= n['keys']['ssh']['host_rsa_public'] %> | ||
<%= n['hostname'] %>,<%= n['fqdn'] %>,<%= n['ipaddress'] %> ssh-dsa <%= n['keys']['ssh']['host_dsa_public'] %> | ||
<% if n['keys']['ssh'].has_key?('host_rsa_public') -%> | ||
<%= n.has_key?('hostname') ? "#{n['hostname']}," : '' %><%= n['fqdn'] %>,<%= n['ipaddress'] %> ssh-rsa <%= n['keys']['ssh']['host_rsa_public'] %> | ||
<% end -%> | ||
<% if n['keys']['ssh'].has_key?('host_dsa_public') -%> | ||
<%= n.has_key?('hostname') ? "#{n['hostname']}," : '' %><%= n['fqdn'] %>,<%= n['ipaddress'] %> ssh-dsa <%= n['keys']['ssh']['host_dsa_public'] %> | ||
<% end -%> | ||
<% end -%> |