tvd-ssh 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
end
|
1
|
+
directory "#{ENV['HOME']}/.ssh" do
|
2
|
+
mode 0700
|
3
|
+
end
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
template "#{ENV['HOME']}/.ssh/config" do
|
6
|
+
source "client_config.erb"
|
7
|
+
mode 0600
|
8
|
+
end
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
template "#{ENV['HOME']}/.ssh/authorized_keys" do
|
11
|
+
source "authorized_keys.erb"
|
12
|
+
mode 0600
|
13
|
+
end
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
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