tvd-ssh 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,25 +1,23 @@
1
- if node[:secrets][:ssh]
2
- directory "#{ENV['HOME']}/.ssh" do
3
- mode 0700
4
- end
1
+ directory "#{ENV['HOME']}/.ssh" do
2
+ mode 0700
3
+ end
5
4
 
6
- template "#{ENV['HOME']}/.ssh/config" do
7
- source "client_config.erb"
8
- mode 0600
9
- end
5
+ template "#{ENV['HOME']}/.ssh/config" do
6
+ source "client_config.erb"
7
+ mode 0600
8
+ end
10
9
 
11
- template "#{ENV['HOME']}/.ssh/authorized_keys" do
12
- source "authorized_keys.erb"
13
- mode 0600
14
- end
10
+ template "#{ENV['HOME']}/.ssh/authorized_keys" do
11
+ source "authorized_keys.erb"
12
+ mode 0600
13
+ end
15
14
 
16
- node[:secrets][:ssh][:known_hosts_files].sort.each do |kh_file, servers|
17
- template "#{ENV['HOME']}/.ssh/#{kh_file}" do
18
- source "known_hosts.erb"
19
- variables(
20
- :servers => servers.sort.inject([]) {|acc, server| acc << [server, node[:secrets][:ssh][:hosts][server]]; acc }
21
- )
22
- mode 0600
23
- end
15
+ node[:secrets][:ssh][:known_hosts_files].sort.each do |kh_file, servers|
16
+ template "#{ENV['HOME']}/.ssh/#{kh_file}" do
17
+ source "known_hosts.erb"
18
+ variables(
19
+ :servers => servers.sort.inject([]) {|acc, server| acc << [server, node[:secrets][:ssh][:hosts][server]]; acc }
20
+ )
21
+ mode 0600
24
22
  end
25
23
  end
@@ -1,6 +1,6 @@
1
1
  Host *
2
2
  User <%= node[:secrets][:username] %>
3
- UserKnownHostsFile ~/.ssh/known_hosts # ~/.ssh/known_hosts2<% node[:secrets][:ssh][:known_hosts_files].keys.sort.each do |kh_file| %> ~/.ssh/<%= kh_file %><% end %>
3
+ UserKnownHostsFile ~/.ssh/known_hosts
4
4
  ServerAliveInterval 60
5
5
  ServerAliveCountMax 3
6
6
  ConnectTimeout 15
@@ -9,10 +9,11 @@ Host *
9
9
  <% node[:secrets][:ssh][:hosts].each do |name, config| %>
10
10
  Host <%= name %>
11
11
  User <%= config[:username] || node[:secrets][:username] %>
12
- Hostname <%= config[:ssh_address] %>
13
12
  Port <%= config[:ssh_port] %>
14
13
  HostKeyAlias <%= config[:alias] || name %>
15
14
  ForwardAgent <%= config[:forward_agent] ? "yes" : "no" %>
16
15
  ForwardX11 <%= config[:forward_x11] ? "yes" : "no" %>
16
+ <% if config[:ssh_address] %>Hostname <%= config[:ssh_address] %><% end %>
17
+
17
18
  <% end %>
18
19
 
@@ -1,3 +1,3 @@
1
1
  <% @servers.each do |nm_server, server| %>
2
- <%= nm_server %>,[<%= server[:ssh_address] %>]:<%= server[:ssh_port] %> <%= server[:ssh_host_key] %>
2
+ <%= nm_server %><% if server[:ssh_address] %>,[<%= server[:ssh_address] %>]:<%= server[:ssh_port] %><% end %> <%= server[:ssh_host_key] %>
3
3
  <% end %>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tvd-ssh
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Bombadil