X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/7b9ec4b60ee39614d1d083d7220e76b07d2b275f..531f7f92d79813c6e0b5e00d1d8c446197e12f27:/cookbooks/openssh/recipes/default.rb?ds=sidebyside diff --git a/cookbooks/openssh/recipes/default.rb b/cookbooks/openssh/recipes/default.rb index 59c8fe7d8..0bae591ce 100644 --- a/cookbooks/openssh/recipes/default.rb +++ b/cookbooks/openssh/recipes/default.rb @@ -24,12 +24,11 @@ package "openssh-client" package "openssh-server" service "ssh" do - action [ :enable, :start ] - if node[:lsb][:release].to_f >= 10.04 - supports :status => true, :restart => true, :reload => true - else - supports :restart => true, :reload => true + if node[:lsb][:release].to_f >= 14.04 + provider Chef::Provider::Service::Upstart end + action [ :enable, :start ] + supports :status => true, :restart => true, :reload => true end hosts = search(:node, "networking:interfaces").sort_by do |node| @@ -46,11 +45,21 @@ end.collect do |node| names |= [ "#{node[:hostname]}.#{node[:networking][:roles][:external][:zone]}.openstreetmap.org" ] end + keys = { + "rsa" => node[:keys][:ssh][:host_rsa_public], + "dsa" => node[:keys][:ssh][:host_dsa_public] + } + + if node[:keys][:ssh][:host_ecdsa_public] + ecdsa_type = node[:keys][:ssh][:host_ecdsa_type] + + keys[ecdsa_type] = node[:keys][:ssh][:host_ecdsa_public] + end + Hash[ :names => names.sort, :addresses => node.ipaddresses.sort, - :rsa => node[:keys][:ssh][:host_rsa_public], - :dsa => node[:keys][:ssh][:host_dsa_public] + :keys => keys ] end